diff options
Diffstat (limited to 'include/xmlsec/skeleton')
-rw-r--r-- | include/xmlsec/skeleton/app.h | 120 | ||||
-rw-r--r-- | include/xmlsec/skeleton/crypto.h | 24 | ||||
-rw-r--r-- | include/xmlsec/skeleton/symbols.h | 162 |
3 files changed, 164 insertions, 142 deletions
diff --git a/include/xmlsec/skeleton/app.h b/include/xmlsec/skeleton/app.h index 33c29697..0429f7ba 100644 --- a/include/xmlsec/skeleton/app.h +++ b/include/xmlsec/skeleton/app.h @@ -1,87 +1,93 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * + * * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> */ #ifndef __XMLSEC_SKELETON_APP_H__ -#define __XMLSEC_SKELETON_APP_H__ +#define __XMLSEC_SKELETON_APP_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <xmlsec/xmlsec.h> #include <xmlsec/keys.h> #include <xmlsec/keysmngr.h> #include <xmlsec/transforms.h> -/** +/******************************************************************** + * * Init/shutdown - */ -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppInit (const char* config); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppShutdown (void); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppInit (const char* config); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppShutdown (void); -/** +/******************************************************************** + * * Keys Manager - */ -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr, - xmlSecKeyPtr key); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, - const char* uri); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, - const char* filename, - xmlSecKeyDataType type); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr, + xmlSecKeyPtr key); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, + const char* uri); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, + const char* filename, + xmlSecKeyDataType type); #ifndef XMLSEC_NO_X509 -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, - const char *filename, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeysMngrCertLoadMemory (xmlSecKeysMngrPtr mngr, - const xmlSecByte *data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, + const char *filename, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeysMngrCertLoadMemory (xmlSecKeysMngrPtr mngr, + const xmlSecByte *data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); #endif /* XMLSEC_NO_X509 */ -/** +/******************************************************************** + * * Keys - */ -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppKeyLoad (const char *filename, - xmlSecKeyDataFormat format, - const char *pwd, - void *pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppKeyLoadMemory (const xmlSecByte *data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format, - const char *pwd, - void *pwdCallback, - void* pwdCallbackCtx); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppKeyLoad (const char *filename, + xmlSecKeyDataFormat format, + const char *pwd, + void *pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppKeyLoadMemory (const xmlSecByte *data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format, + const char *pwd, + void *pwdCallback, + void* pwdCallbackCtx); #ifndef XMLSEC_NO_X509 -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppPkcs12Load (const char *filename, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppPkcs12LoadMemory (const xmlSecByte *data, - xmlSecSize dataSize, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeyCertLoad (xmlSecKeyPtr key, - const char* filename, - xmlSecKeyDataFormat format); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeyCertLoadMemory (xmlSecKeyPtr key, - const xmlSecByte *data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppPkcs12Load (const char *filename, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecSkeletonAppPkcs12LoadMemory (const xmlSecByte *data, + xmlSecSize dataSize, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeyCertLoad (xmlSecKeyPtr key, + const char* filename, + xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonAppKeyCertLoadMemory (xmlSecKeyPtr key, + const xmlSecByte *data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format); #endif /* XMLSEC_NO_X509 */ -XMLSEC_CRYPTO_EXPORT void* xmlSecSkeletonAppGetDefaultPwdCallback (void); +XMLSEC_CRYPTO_EXPORT void* xmlSecSkeletonAppGetDefaultPwdCallback (void); #ifdef __cplusplus } diff --git a/include/xmlsec/skeleton/crypto.h b/include/xmlsec/skeleton/crypto.h index 3b32c237..30346669 100644 --- a/include/xmlsec/skeleton/crypto.h +++ b/include/xmlsec/skeleton/crypto.h @@ -1,32 +1,34 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * + * * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> */ #ifndef __XMLSEC_SKELETON_CRYPTO_H__ -#define __XMLSEC_SKELETON_CRYPTO_H__ +#define __XMLSEC_SKELETON_CRYPTO_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <xmlsec/xmlsec.h> #include <xmlsec/keys.h> #include <xmlsec/transforms.h> #include <xmlsec/dl.h> -XMLSEC_CRYPTO_EXPORT xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_skeleton(void); +XMLSEC_CRYPTO_EXPORT xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_skeleton(void); -/** +/******************************************************************** + * * Init shutdown - */ -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonInit (void); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonShutdown (void); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonInit (void); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonShutdown (void); -XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonKeysMngrInit (xmlSecKeysMngrPtr mngr); +XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonKeysMngrInit (xmlSecKeysMngrPtr mngr); #ifdef __cplusplus @@ -35,4 +37,4 @@ XMLSEC_CRYPTO_EXPORT int xmlSecSkeletonKeysMngrInit (xmlSecKeysMngrPtr mngr); #endif /* __XMLSEC_SKELETON_CRYPTO_H__ */ -#define __XMLSEC_SKELETON_CRYPTO_H__ +#define __XMLSEC_SKELETON_CRYPTO_H__ diff --git a/include/xmlsec/skeleton/symbols.h b/include/xmlsec/skeleton/symbols.h index 1473f011..9902d3f7 100644 --- a/include/xmlsec/skeleton/symbols.h +++ b/include/xmlsec/skeleton/symbols.h @@ -1,13 +1,13 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * + * * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> */ #ifndef __XMLSEC_SKELETON_SYMBOLS_H__ -#define __XMLSEC_SKELETON_SYMBOLS_H__ +#define __XMLSEC_SKELETON_SYMBOLS_H__ #if !defined(IN_XMLSEC) && defined(XMLSEC_CRYPTO_DYNAMIC_LOADING) #error To disable dynamic loading of xmlsec-crypto libraries undefine XMLSEC_CRYPTO_DYNAMIC_LOADING @@ -15,89 +15,103 @@ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ -/** - * Defines for writing simple code - */ #ifdef XMLSEC_CRYPTO_SKELETON -/** +/******************************************************************** + * * Crypto Init/shutdown - */ -#define xmlSecCryptoInit xmlSecSkeletonInit -#define xmlSecCryptoShutdown xmlSecSkeletonShutdown + * + ********************************************************************/ +#define xmlSecCryptoInit xmlSecSkeletonInit +#define xmlSecCryptoShutdown xmlSecSkeletonShutdown -#define xmlSecCryptoKeysMngrInit xmlSecSkeletonKeysMngrInit +#define xmlSecCryptoKeysMngrInit xmlSecSkeletonKeysMngrInit -/** +/******************************************************************** + * * Key data ids - */ -#define xmlSecKeyDataAesId xmlSecSkeletonKeyDataAesId -#define xmlSecKeyDataDesId xmlSecSkeletonKeyDataDesId -#define xmlSecKeyDataDsaId xmlSecSkeletonKeyDataDsaId -#define xmlSecKeyDataHmacId xmlSecSkeletonKeyDataHmacId -#define xmlSecKeyDataRsaId xmlSecSkeletonKeyDataRsaId -#define xmlSecKeyDataX509Id xmlSecSkeletonKeyDataX509Id -#define xmlSecKeyDataRawX509CertId xmlSecSkeletonKeyDataRawX509CertId + * + ********************************************************************/ +#define xmlSecKeyDataAesId xmlSecSkeletonKeyDataAesId +#define xmlSecKeyDataDesId xmlSecSkeletonKeyDataDesId +#define xmlSecKeyDataDsaId xmlSecSkeletonKeyDataDsaId +#define xmlSecKeyDataEcdsaId xmlSecSkeletonKeyDataEcdsaId +#define xmlSecKeyDataHmacId xmlSecSkeletonKeyDataHmacId +#define xmlSecKeyDataRsaId xmlSecSkeletonKeyDataRsaId +#define xmlSecKeyDataX509Id xmlSecSkeletonKeyDataX509Id +#define xmlSecKeyDataRawX509CertId xmlSecSkeletonKeyDataRawX509CertId -/** +/******************************************************************** + * * Key data store ids - */ -#define xmlSecX509StoreId xmlSecSkeletonX509StoreId + * + ********************************************************************/ +#define xmlSecX509StoreId xmlSecSkeletonX509StoreId -/** +/******************************************************************** + * * Crypto transforms ids - */ -#define xmlSecTransformAes128CbcId xmlSecSkeletonTransformAes128CbcId -#define xmlSecTransformAes192CbcId xmlSecSkeletonTransformAes192CbcId -#define xmlSecTransformAes256CbcId xmlSecSkeletonTransformAes256CbcId -#define xmlSecTransformKWAes128Id xmlSecSkeletonTransformKWAes128Id -#define xmlSecTransformKWAes192Id xmlSecSkeletonTransformKWAes192Id -#define xmlSecTransformKWAes256Id xmlSecSkeletonTransformKWAes256Id -#define xmlSecTransformDes3CbcId xmlSecSkeletonTransformDes3CbcId -#define xmlSecTransformKWDes3Id xmlSecSkeletonTransformKWDes3Id -#define xmlSecTransformDsaSha1Id xmlSecSkeletonTransformDsaSha1Id -#define xmlSecTransformHmacMd5Id xmlSecSkeletonTransformHmacMd5Id -#define xmlSecTransformHmacRipemd160Id xmlSecSkeletonTransformHmacRipemd160Id -#define xmlSecTransformHmacSha1Id xmlSecSkeletonTransformHmacSha1Id -#define xmlSecTransformHmacSha224Id xmlSecSkeletonTransformHmacSha224Id -#define xmlSecTransformHmacSha256Id xmlSecSkeletonTransformHmacSha256Id -#define xmlSecTransformHmacSha384Id xmlSecSkeletonTransformHmacSha384Id -#define xmlSecTransformHmacSha512Id xmlSecSkeletonTransformHmacSha512Id -#define xmlSecTransformMd5Id xmlSecSkeletonTransformMd5Id -#define xmlSecTransformRipemd160Id xmlSecSkeletonTransformRipemd160Id -#define xmlSecTransformRsaSha1Id xmlSecSkeletonTransformRsaSha1Id -#define xmlSecTransformRsaSha224Id xmlSecSkeletonTransformRsaSha224Id -#define xmlSecTransformRsaSha256Id xmlSecSkeletonTransformRsaSha256Id -#define xmlSecTransformRsaSha384Id xmlSecSkeletonTransformRsaSha384Id -#define xmlSecTransformRsaSha512Id xmlSecSkeletonTransformRsaSha512Id -#define xmlSecTransformRsaPkcs1Id xmlSecSkeletonTransformRsaPkcs1Id -#define xmlSecTransformRsaOaepId xmlSecSkeletonTransformRsaOaepId -#define xmlSecTransformSha1Id xmlSecSkeletonTransformSha1Id -#define xmlSecTransformSha224Id xmlSecSkeletonTransformSha224Id -#define xmlSecTransformSha256Id xmlSecSkeletonTransformSha256Id -#define xmlSecTransformSha384Id xmlSecSkeletonTransformSha384Id -#define xmlSecTransformSha512Id xmlSecSkeletonTransformSha512Id + * + ********************************************************************/ +#define xmlSecTransformAes128CbcId xmlSecSkeletonTransformAes128CbcId +#define xmlSecTransformAes192CbcId xmlSecSkeletonTransformAes192CbcId +#define xmlSecTransformAes256CbcId xmlSecSkeletonTransformAes256CbcId +#define xmlSecTransformKWAes128Id xmlSecSkeletonTransformKWAes128Id +#define xmlSecTransformKWAes192Id xmlSecSkeletonTransformKWAes192Id +#define xmlSecTransformKWAes256Id xmlSecSkeletonTransformKWAes256Id +#define xmlSecTransformDes3CbcId xmlSecSkeletonTransformDes3CbcId +#define xmlSecTransformKWDes3Id xmlSecSkeletonTransformKWDes3Id +#define xmlSecTransformDsaSha1Id xmlSecSkeletonTransformDsaSha1Id +#define xmlSecTransformDsaSha256Id xmlSecSkeletonTransformDsaSha256Id +#define xmlSecTransformEcdsaSha1Id xmlSecSkeletonTransformEcdsaSha1Id +#define xmlSecTransformEcdsaSha224Id xmlSecSkeletonTransformEcdsaSha224Id +#define xmlSecTransformEcdsaSha256Id xmlSecSkeletonTransformEcdsaSha256Id +#define xmlSecTransformEcdsaSha384Id xmlSecSkeletonTransformEcdsaSha384Id +#define xmlSecTransformEcdsaSha512Id xmlSecSkeletonTransformEcdsaSha512Id +#define xmlSecTransformHmacMd5Id xmlSecSkeletonTransformHmacMd5Id +#define xmlSecTransformHmacRipemd160Id xmlSecSkeletonTransformHmacRipemd160Id +#define xmlSecTransformHmacSha1Id xmlSecSkeletonTransformHmacSha1Id +#define xmlSecTransformHmacSha224Id xmlSecSkeletonTransformHmacSha224Id +#define xmlSecTransformHmacSha256Id xmlSecSkeletonTransformHmacSha256Id +#define xmlSecTransformHmacSha384Id xmlSecSkeletonTransformHmacSha384Id +#define xmlSecTransformHmacSha512Id xmlSecSkeletonTransformHmacSha512Id +#define xmlSecTransformMd5Id xmlSecSkeletonTransformMd5Id +#define xmlSecTransformRipemd160Id xmlSecSkeletonTransformRipemd160Id +#define xmlSecTransformRsaSha1Id xmlSecSkeletonTransformRsaSha1Id +#define xmlSecTransformRsaSha224Id xmlSecSkeletonTransformRsaSha224Id +#define xmlSecTransformRsaSha256Id xmlSecSkeletonTransformRsaSha256Id +#define xmlSecTransformRsaSha384Id xmlSecSkeletonTransformRsaSha384Id +#define xmlSecTransformRsaSha512Id xmlSecSkeletonTransformRsaSha512Id +#define xmlSecTransformRsaPkcs1Id xmlSecSkeletonTransformRsaPkcs1Id +#define xmlSecTransformRsaOaepId xmlSecSkeletonTransformRsaOaepId +#define xmlSecTransformSha1Id xmlSecSkeletonTransformSha1Id +#define xmlSecTransformSha224Id xmlSecSkeletonTransformSha224Id +#define xmlSecTransformSha256Id xmlSecSkeletonTransformSha256Id +#define xmlSecTransformSha384Id xmlSecSkeletonTransformSha384Id +#define xmlSecTransformSha512Id xmlSecSkeletonTransformSha512Id -/** +/******************************************************************** + * * High level routines form xmlsec command line utility - */ -#define xmlSecCryptoAppInit xmlSecSkeletonAppInit -#define xmlSecCryptoAppShutdown xmlSecSkeletonAppShutdown -#define xmlSecCryptoAppDefaultKeysMngrInit xmlSecSkeletonAppDefaultKeysMngrInit -#define xmlSecCryptoAppDefaultKeysMngrAdoptKey xmlSecSkeletonAppDefaultKeysMngrAdoptKey -#define xmlSecCryptoAppDefaultKeysMngrLoad xmlSecSkeletonAppDefaultKeysMngrLoad -#define xmlSecCryptoAppDefaultKeysMngrSave xmlSecSkeletonAppDefaultKeysMngrSave -#define xmlSecCryptoAppKeysMngrCertLoad xmlSecSkeletonAppKeysMngrCertLoad -#define xmlSecCryptoAppKeysMngrCertLoadMemory xmlSecSkeletonAppKeysMngrCertLoadMemory -#define xmlSecCryptoAppKeyLoad xmlSecSkeletonAppKeyLoad -#define xmlSecCryptoAppPkcs12Load xmlSecSkeletonAppPkcs12Load -#define xmlSecCryptoAppKeyCertLoad xmlSecSkeletonAppKeyCertLoad -#define xmlSecCryptoAppKeyLoadMemory xmlSecSkeletonAppKeyLoadMemory -#define xmlSecCryptoAppPkcs12LoadMemory xmlSecSkeletonAppPkcs12LoadMemory -#define xmlSecCryptoAppKeyCertLoadMemory xmlSecSkeletonAppKeyCertLoadMemory -#define xmlSecCryptoAppGetDefaultPwdCallback xmlSecSkeletonAppGetDefaultPwdCallback + * + ********************************************************************/ +#define xmlSecCryptoAppInit xmlSecSkeletonAppInit +#define xmlSecCryptoAppShutdown xmlSecSkeletonAppShutdown +#define xmlSecCryptoAppDefaultKeysMngrInit xmlSecSkeletonAppDefaultKeysMngrInit +#define xmlSecCryptoAppDefaultKeysMngrAdoptKey xmlSecSkeletonAppDefaultKeysMngrAdoptKey +#define xmlSecCryptoAppDefaultKeysMngrLoad xmlSecSkeletonAppDefaultKeysMngrLoad +#define xmlSecCryptoAppDefaultKeysMngrSave xmlSecSkeletonAppDefaultKeysMngrSave +#define xmlSecCryptoAppKeysMngrCertLoad xmlSecSkeletonAppKeysMngrCertLoad +#define xmlSecCryptoAppKeysMngrCertLoadMemory xmlSecSkeletonAppKeysMngrCertLoadMemory +#define xmlSecCryptoAppKeyLoad xmlSecSkeletonAppKeyLoad +#define xmlSecCryptoAppPkcs12Load xmlSecSkeletonAppPkcs12Load +#define xmlSecCryptoAppKeyCertLoad xmlSecSkeletonAppKeyCertLoad +#define xmlSecCryptoAppKeyLoadMemory xmlSecSkeletonAppKeyLoadMemory +#define xmlSecCryptoAppPkcs12LoadMemory xmlSecSkeletonAppPkcs12LoadMemory +#define xmlSecCryptoAppKeyCertLoadMemory xmlSecSkeletonAppKeyCertLoadMemory +#define xmlSecCryptoAppGetDefaultPwdCallback xmlSecSkeletonAppGetDefaultPwdCallback #endif /* XMLSEC_CRYPTO_SKELETON */ @@ -107,4 +121,4 @@ extern "C" { #endif /* __XMLSEC_SKELETON_CRYPTO_H__ */ -#define __XMLSEC_SKELETON_CRYPTO_H__ +#define __XMLSEC_SKELETON_CRYPTO_H__ |