diff options
Diffstat (limited to 'include/xmlsec/mscrypto')
-rw-r--r-- | include/xmlsec/mscrypto/Makefile.in | 20 | ||||
-rw-r--r-- | include/xmlsec/mscrypto/app.h | 166 | ||||
-rw-r--r-- | include/xmlsec/mscrypto/certkeys.h | 28 | ||||
-rw-r--r-- | include/xmlsec/mscrypto/crypto.h | 392 | ||||
-rw-r--r-- | include/xmlsec/mscrypto/keysstore.h | 36 | ||||
-rw-r--r-- | include/xmlsec/mscrypto/symbols.h | 144 | ||||
-rw-r--r-- | include/xmlsec/mscrypto/x509.h | 103 |
7 files changed, 318 insertions, 571 deletions
diff --git a/include/xmlsec/mscrypto/Makefile.in b/include/xmlsec/mscrypto/Makefile.in index 477c5cb3..1570c0f0 100644 --- a/include/xmlsec/mscrypto/Makefile.in +++ b/include/xmlsec/mscrypto/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -38,13 +38,10 @@ subdir = include/xmlsec/mscrypto DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(xmlsecmscryptoinc_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @@ -100,10 +97,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -GCRYPT_CFLAGS = @GCRYPT_CFLAGS@ -GCRYPT_CRYPTO_LIB = @GCRYPT_CRYPTO_LIB@ -GCRYPT_LIBS = @GCRYPT_LIBS@ -GCRYPT_MIN_VERSION = @GCRYPT_MIN_VERSION@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_CRYPTO_LIB = @GNUTLS_CRYPTO_LIB@ GNUTLS_LIBS = @GNUTLS_LIBS@ @@ -165,10 +158,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGCONFIG_PRESENT = @PKGCONFIG_PRESENT@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_ENABLED = @PKG_CONFIG_ENABLED@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ @@ -195,8 +186,6 @@ XMLSEC_DL_INCLUDES = @XMLSEC_DL_INCLUDES@ XMLSEC_DL_LIBS = @XMLSEC_DL_LIBS@ XMLSEC_DOCDIR = @XMLSEC_DOCDIR@ XMLSEC_EXTRA_LDFLAGS = @XMLSEC_EXTRA_LDFLAGS@ -XMLSEC_GCRYPT_CFLAGS = @XMLSEC_GCRYPT_CFLAGS@ -XMLSEC_GCRYPT_LIBS = @XMLSEC_GCRYPT_LIBS@ XMLSEC_GNUTLS_CFLAGS = @XMLSEC_GNUTLS_CFLAGS@ XMLSEC_GNUTLS_LIBS = @XMLSEC_GNUTLS_LIBS@ XMLSEC_LIBDIR = @XMLSEC_LIBDIR@ @@ -206,7 +195,6 @@ XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING = @XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING@ XMLSEC_NO_CRYPTO_DYNAMIC_LOADING = @XMLSEC_NO_CRYPTO_DYNAMIC_LOADING@ XMLSEC_NO_DES = @XMLSEC_NO_DES@ XMLSEC_NO_DSA = @XMLSEC_NO_DSA@ -XMLSEC_NO_GCRYPT = @XMLSEC_NO_GCRYPT@ XMLSEC_NO_GNUTLS = @XMLSEC_NO_GNUTLS@ XMLSEC_NO_GOST = @XMLSEC_NO_GOST@ XMLSEC_NO_HMAC = @XMLSEC_NO_HMAC@ diff --git a/include/xmlsec/mscrypto/app.h b/include/xmlsec/mscrypto/app.h index 3d23d0e5..964cffcf 100644 --- a/include/xmlsec/mscrypto/app.h +++ b/include/xmlsec/mscrypto/app.h @@ -1,17 +1,17 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * - * Copyright (C) 2003 Cordys R&D BV, All rights reserved. + * + * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved. */ #ifndef __XMLSEC_MSCRYPTO_APP_H__ -#define __XMLSEC_MSCRYPTO_APP_H__ +#define __XMLSEC_MSCRYPTO_APP_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <xmlsec/xmlsec.h> #include <xmlsec/keys.h> @@ -21,92 +21,98 @@ extern "C" { #include <windows.h> #include <wincrypt.h> -/******************************************************************** - * +/** * Init/shutdown - * - ********************************************************************/ -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppInit (const char* config); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppShutdown (void); -XMLSEC_CRYPTO_EXPORT LPCTSTR xmlSecMSCryptoAppGetCertStoreName (void); + */ +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppInit (const char* config); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppShutdown (void); +XMLSEC_CRYPTO_EXPORT const char*xmlSecMSCryptoAppGetCertStoreName (void); -/******************************************************************** - * +/** * Keys Manager - * - ********************************************************************/ -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptKey (xmlSecKeysMngrPtr mngr, - xmlSecKeyPtr key); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, - const char* uri); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, - const char* filename, - xmlSecKeyDataType type); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrPrivateKeyLoad (xmlSecKeysMngrPtr mngr, - HCRYPTKEY hKey); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrPublicKeyLoad (xmlSecKeysMngrPtr mngr, - HCRYPTKEY hKey); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrSymKeyLoad (xmlSecKeysMngrPtr mngr, - HCRYPTKEY hKey); + */ +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrInit( + xmlSecKeysMngrPtr mngr); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptKey( + xmlSecKeysMngrPtr mngr, + xmlSecKeyPtr key); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrLoad( + xmlSecKeysMngrPtr mngr, + const char* uri); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrSave( + xmlSecKeysMngrPtr mngr, + const char* filename, + xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrPrivateKeyLoad(
+ xmlSecKeysMngrPtr mngr,
+ HCRYPTKEY hKey);
+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrPublicKeyLoad(
+ xmlSecKeysMngrPtr mngr,
+ HCRYPTKEY hKey);
+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrSymKeyLoad(
+ xmlSecKeysMngrPtr mngr,
+ HCRYPTKEY hKey); #ifndef XMLSEC_NO_X509 -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptKeyStore (xmlSecKeysMngrPtr mngr, - HCERTSTORE keyStore); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptTrustedStore(xmlSecKeysMngrPtr mngr, - HCERTSTORE trustedStore); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptUntrustedStore(xmlSecKeysMngrPtr mngr, - HCERTSTORE untrustedStore); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, - const char *filename, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeysMngrCertLoadMemory (xmlSecKeysMngrPtr mngr, - const xmlSecByte* data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptKeyStore(
+ xmlSecKeysMngrPtr mngr,
+ HCERTSTORE keyStore);
+
+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptTrustedStore(
+ xmlSecKeysMngrPtr mngr,
+ HCERTSTORE trustedStore);
+
+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppDefaultKeysMngrAdoptUntrustedStore(
+ xmlSecKeysMngrPtr mngr,
+ HCERTSTORE untrustedStore);
+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeysMngrCertLoad( + xmlSecKeysMngrPtr mngr, + const char *filename, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeysMngrCertLoadMemory( + xmlSecKeysMngrPtr mngr, + const xmlSecByte* data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); +
#endif /* XMLSEC_NO_X509 */ -/******************************************************************** - * +/** * Keys - * - ********************************************************************/ -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppKeyLoad (const char *filename, - xmlSecKeyDataFormat format, - const char *pwd, - void *pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppKeyLoadMemory (const xmlSecByte* data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); + */ +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppKeyLoad (const char *filename, + xmlSecKeyDataFormat format, + const char *pwd, + void *pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppKeyLoadMemory (const xmlSecByte* data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); #ifndef XMLSEC_NO_X509 -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppPkcs12Load (const char *filename, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppPkcs12LoadMemory (const xmlSecByte* data, - xmlSecSize dataSize, - const char* pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeyCertLoad (xmlSecKeyPtr key, - const char* filename, - xmlSecKeyDataFormat format); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeyCertLoadMemory (xmlSecKeyPtr key, - const xmlSecByte* data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppPkcs12Load (const char *filename, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppPkcs12LoadMemory (const xmlSecByte* data, + xmlSecSize dataSize, + const char* pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeyCertLoad (xmlSecKeyPtr key, + const char* filename, + xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoAppKeyCertLoadMemory (xmlSecKeyPtr key, + const xmlSecByte* data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format); #endif /* XMLSEC_NO_X509 */ -XMLSEC_CRYPTO_EXPORT void* xmlSecMSCryptoAppGetDefaultPwdCallback (void); +XMLSEC_CRYPTO_EXPORT void* xmlSecMSCryptoAppGetDefaultPwdCallback (void); #ifdef __cplusplus } diff --git a/include/xmlsec/mscrypto/certkeys.h b/include/xmlsec/mscrypto/certkeys.h index 1f285656..4ae85240 100644 --- a/include/xmlsec/mscrypto/certkeys.h +++ b/include/xmlsec/mscrypto/certkeys.h @@ -1,17 +1,17 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * - * Copyright (C) 2003 Cordys R&D BV, All rights reserved. + * + * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved. */ #ifndef __XMLSEC_MSCRYPTO_CERTKEYS_H__ -#define __XMLSEC_MSCRYPTO_CERTKEYS_H__ +#define __XMLSEC_MSCRYPTO_CERTKEYS_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <windows.h> #include <wincrypt.h> @@ -20,18 +20,12 @@ extern "C" { #include <xmlsec/keys.h> #include <xmlsec/transforms.h> - -XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoKeyDataGetCert (xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT HCRYPTKEY xmlSecMSCryptoKeyDataGetKey (xmlSecKeyDataPtr data, - xmlSecKeyDataType type); -XMLSEC_CRYPTO_EXPORT HCRYPTKEY xmlSecMSCryptoKeyDataGetDecryptKey(xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoCertDup (PCCERT_CONTEXT pCert); -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecMSCryptoCertAdopt (PCCERT_CONTEXT pCert, - xmlSecKeyDataType type); - -XMLSEC_CRYPTO_EXPORT HCRYPTPROV xmlSecMSCryptoKeyDataGetMSCryptoProvider(xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT DWORD xmlSecMSCryptoKeyDataGetMSCryptoKeySpec(xmlSecKeyDataPtr data); - +XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoKeyDataGetCert (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT HCRYPTKEY xmlSecMSCryptoKeyDataGetKey (xmlSecKeyDataPtr data, + xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT HCRYPTKEY xmlSecMSCryptoKeyDataGetDecryptKey(xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoCertDup (PCCERT_CONTEXT pCert); +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecMSCryptoCertAdopt (PCCERT_CONTEXT pCert, xmlSecKeyDataType type); #ifdef __cplusplus } diff --git a/include/xmlsec/mscrypto/crypto.h b/include/xmlsec/mscrypto/crypto.h index 5f3142fc..28d792aa 100644 --- a/include/xmlsec/mscrypto/crypto.h +++ b/include/xmlsec/mscrypto/crypto.h @@ -1,17 +1,17 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * - * Copyright (C) 2003 Cordys R&D BV, All rights reserved. + * + * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved. */ #ifndef __XMLSEC_MSCRYPTO_CRYPTO_H__ -#define __XMLSEC_MSCRYPTO_CRYPTO_H__ +#define __XMLSEC_MSCRYPTO_CRYPTO_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <windows.h> #include <wincrypt.h> @@ -21,43 +21,34 @@ extern "C" { #include <xmlsec/transforms.h> #include <xmlsec/dl.h> -XMLSEC_CRYPTO_EXPORT xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_mscrypto(void); +XMLSEC_CRYPTO_EXPORT xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_mscrypto(void); -/******************************************************************** - * +/** * Init shutdown - * - ********************************************************************/ -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoInit (void); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoShutdown (void); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysMngrInit (xmlSecKeysMngrPtr mngr); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoGenerateRandom (xmlSecBufferPtr buffer, - size_t size); - -XMLSEC_CRYPTO_EXPORT void xmlSecMSCryptoErrorsDefaultCallback(const char* file, - int line, - const char* func, - const char* errorObject, - const char* errorSubject, - int reason, - const char* msg); - -/****************************************************************************** - * - * String encoding conversion utils - * - ******************************************************************************/ -XMLSEC_CRYPTO_EXPORT LPWSTR xmlSecMSCryptoConvertLocaleToUnicode(const char* str); + */ +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoInit (void); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoShutdown (void); -XMLSEC_CRYPTO_EXPORT LPWSTR xmlSecMSCryptoConvertUtf8ToUnicode (const xmlChar* str); -XMLSEC_CRYPTO_EXPORT xmlChar* xmlSecMSCryptoConvertUnicodeToUtf8 (LPCWSTR str); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysMngrInit (xmlSecKeysMngrPtr mngr); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoGenerateRandom (xmlSecBufferPtr buffer, + size_t size); -XMLSEC_CRYPTO_EXPORT xmlChar* xmlSecMSCryptoConvertLocaleToUtf8 (const char* str); -XMLSEC_CRYPTO_EXPORT char* xmlSecMSCryptoConvertUtf8ToLocale (const xmlChar* str); +XMLSEC_CRYPTO_EXPORT void xmlSecMSCryptoErrorsDefaultCallback(const char* file, + int line, + const char* func, + const char* errorObject, + const char* errorSubject, + int reason, + const char* msg); + +/** + * Utils + */ +XMLSEC_CRYPTO_EXPORT BYTE* xmlSecMSCryptoCertStrToName (DWORD dwCertEncodingType, + LPCTSTR pszX500, + DWORD dwStrType, + DWORD* len); -XMLSEC_CRYPTO_EXPORT xmlChar* xmlSecMSCryptoConvertTstrToUtf8 (LPCTSTR str); -XMLSEC_CRYPTO_EXPORT LPTSTR xmlSecMSCryptoConvertUtf8ToTstr (const xmlChar* str); /******************************************************************** @@ -69,20 +60,20 @@ XMLSEC_CRYPTO_EXPORT LPTSTR xmlSecMSCryptoConvertUtf8ToTstr (con /** * xmlSecMSCryptoKeyDataDsaId: - * + * * The DSA key klass. */ #define xmlSecMSCryptoKeyDataDsaId \ - xmlSecMSCryptoKeyDataDsaGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataDsaGetKlass (void); + xmlSecMSCryptoKeyDataDsaGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataDsaGetKlass (void); /** * xmlSecMSCryptoTransformDsaSha1Id: - * + * * The DSA SHA1 signature transform klass. */ #define xmlSecMSCryptoTransformDsaSha1Id \ - xmlSecMSCryptoTransformDsaSha1GetKlass() + xmlSecMSCryptoTransformDsaSha1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformDsaSha1GetKlass(void); #endif /* XMLSEC_NO_DSA */ @@ -96,20 +87,20 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformDsaSha1GetKlass(vo /** * xmlSecMSCryptoKeyDataGost2001Id: - * + * * The GOST2001 key klass. */ #define xmlSecMSCryptoKeyDataGost2001Id \ - xmlSecMSCryptoKeyDataGost2001GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataGost2001GetKlass (void); + xmlSecMSCryptoKeyDataGost2001GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataGost2001GetKlass (void); /** * xmlSecMSCryptoTransformGost2001GostR3411_94Id: - * + * * The GOST2001 GOSTR3411_94 signature transform klass. */ #define xmlSecMSCryptoTransformGost2001GostR3411_94Id \ - xmlSecMSCryptoTransformGost2001GostR3411_94GetKlass() + xmlSecMSCryptoTransformGost2001GostR3411_94GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformGost2001GostR3411_94GetKlass(void); #endif /* XMLSEC_NO_GOST */ @@ -123,117 +114,47 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformGost2001GostR3411_ /** * xmlSecMSCryptoKeyDataRsaId: - * + * * The RSA key klass. */ #define xmlSecMSCryptoKeyDataRsaId \ - xmlSecMSCryptoKeyDataRsaGetKlass() + xmlSecMSCryptoKeyDataRsaGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataRsaGetKlass(void); -#ifndef XMLSEC_NO_MD5 -/** - * xmlSecMSCryptoTransformRsaMd5Id: - * - * The RSA-MD5 signature transform klass. - */ -#define xmlSecMSCryptoTransformRsaMd5Id \ - xmlSecMSCryptoTransformRsaMd5GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaMd5GetKlass(void); -#endif /* XMLSEC_NO_MD5 */ -#ifndef XMLSEC_NO_SHA1 /** * xmlSecMSCryptoTransformRsaSha1Id: - * + * * The RSA-SHA1 signature transform klass. */ -#define xmlSecMSCryptoTransformRsaSha1Id \ - xmlSecMSCryptoTransformRsaSha1GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaSha1GetKlass(void); -#endif /* XMLSEC_NO_SHA1 */ -#ifndef XMLSEC_NO_SHA256 -/** - * xmlSecMSCryptoTransformRsaSha256Id: - * - * The RSA-SHA256 signature transform klass. - */ -#define xmlSecMSCryptoTransformRsaSha256Id \ - xmlSecMSCryptoTransformRsaSha256GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaSha256GetKlass(void); -#endif /* XMLSEC_NO_SHA256 */ - -#ifndef XMLSEC_NO_SHA384 -/** - * xmlSecMSCryptoTransformRsaSha384Id: - * - * The RSA-SHA384 signature transform klass. - */ -#define xmlSecMSCryptoTransformRsaSha384Id \ - xmlSecMSCryptoTransformRsaSha384GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaSha384GetKlass(void); -#endif /* XMLSEC_NO_SHA384 */ - -#ifndef XMLSEC_NO_SHA512 -/** - * xmlSecMSCryptoTransformRsaSha512Id: - * - * The RSA-SHA512 signature transform klass. - */ -#define xmlSecMSCryptoTransformRsaSha512Id \ - xmlSecMSCryptoTransformRsaSha512GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaSha512GetKlass(void); -#endif /* XMLSEC_NO_SHA512 */ +#define xmlSecMSCryptoTransformRsaSha1Id \ + xmlSecMSCryptoTransformRsaSha1GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaSha1GetKlass(void); /** * xmlSecMSCryptoTransformRsaPkcs1Id: - * + * * The RSA PKCS1 key transport transform klass. */ #define xmlSecMSCryptoTransformRsaPkcs1Id \ - xmlSecMSCryptoTransformRsaPkcs1GetKlass() + xmlSecMSCryptoTransformRsaPkcs1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaPkcs1GetKlass(void); /** * xmlSecMSCryptoTransformRsaOaepId: - * - * The RSA OAEP key transport transform klass. - */ -#define xmlSecMSCryptoTransformRsaOaepId \ - xmlSecMSCryptoTransformRsaOaepGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaOaepGetKlass(void); - -/** - * xmlSecMSCryptoTransformRsaOaepId: - * + * * The RSA PKCS1 key transport transform klass. */ /* #define xmlSecMSCryptoTransformRsaOaepId \ - xmlSecMSCryptoTransformRsaOaepGetKlass() + xmlSecMSCryptoTransformRsaOaepGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformRsaOaepGetKlass(void); */ #endif /* XMLSEC_NO_RSA */ /******************************************************************** * - * Md5 transforms - * - *******************************************************************/ -#ifndef XMLSEC_NO_MD5 -/** - * xmlSecMSCryptoTransformMd5Id: - * - * The MD5 digest transform klass. - */ -#define xmlSecMSCryptoTransformMd5Id \ - xmlSecMSCryptoTransformMd5GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformMd5GetKlass(void); -#endif /* XMLSEC_NO_MD5 */ - - -/******************************************************************** - * * SHA1 transform * *******************************************************************/ @@ -241,67 +162,16 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformMd5GetKlass(void); /** * xmlSecMSCryptoTransformSha1Id: - * + * * The SHA1 digest transform klass. */ #define xmlSecMSCryptoTransformSha1Id \ - xmlSecMSCryptoTransformSha1GetKlass() + xmlSecMSCryptoTransformSha1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformSha1GetKlass(void); #endif /* XMLSEC_NO_SHA1 */ /******************************************************************** * - * SHA256 transform - * - *******************************************************************/ -#ifndef XMLSEC_NO_SHA256 - -/** - * xmlSecMSCryptoTransformSha256Id: - * - * The SHA256 digest transform klass. - */ -#define xmlSecMSCryptoTransformSha256Id \ - xmlSecMSCryptoTransformSha256GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformSha256GetKlass(void); -#endif /* XMLSEC_NO_SHA256 */ - -/******************************************************************** - * - * SHA384 transform - * - *******************************************************************/ -#ifndef XMLSEC_NO_SHA384 - -/** - * xmlSecMSCryptoTransformSha384Id: - * - * The SHA384 digest transform klass. - */ -#define xmlSecMSCryptoTransformSha384Id \ - xmlSecMSCryptoTransformSha384GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformSha384GetKlass(void); -#endif /* XMLSEC_NO_SHA384 */ - -/******************************************************************** - * - * SHA512 transform - * - *******************************************************************/ -#ifndef XMLSEC_NO_SHA512 - -/** - * xmlSecMSCryptoTransformSha512Id: - * - * The SHA512 digest transform klass. - */ -#define xmlSecMSCryptoTransformSha512Id \ - xmlSecMSCryptoTransformSha512GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformSha512GetKlass(void); -#endif /* XMLSEC_NO_SHA512 */ - -/******************************************************************** - * * GOSTR3411_94 transform * *******************************************************************/ @@ -309,11 +179,11 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformSha512GetKlass(voi /** * xmlSecMSCryptoTransformGostR3411_94Id: - * + * * The GOSTR3411_94 digest transform klass. */ #define xmlSecMSCryptoTransformGostR3411_94Id \ - xmlSecMSCryptoTransformGostR3411_94GetKlass() + xmlSecMSCryptoTransformGostR3411_94GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformGostR3411_94GetKlass(void); #endif /* XMLSEC_NO_GOST */ @@ -325,68 +195,41 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformGostR3411_94GetKla #ifndef XMLSEC_NO_AES /** * xmlSecMSCryptoKeyDataAesId: - * + * * The AES key data klass. */ #define xmlSecMSCryptoKeyDataAesId \ - xmlSecMSCryptoKeyDataAesGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataAesGetKlass(void); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataAesSet (xmlSecKeyDataPtr data, - const xmlSecByte* buf, - xmlSecSize bufSize); + xmlSecMSCryptoKeyDataAesGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataAesGetKlass(void); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataAesSet (xmlSecKeyDataPtr data, + const xmlSecByte* buf, + xmlSecSize bufSize); /** * xmlSecMSCryptoTransformAes128CbcId: - * + * * The AES128 CBC cipher transform klass. */ #define xmlSecMSCryptoTransformAes128CbcId \ - xmlSecMSCryptoTransformAes128CbcGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformAes128CbcGetKlass(void); + xmlSecMSCryptoTransformAes128CbcGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformAes128CbcGetKlass(void); /** * xmlSecMSCryptoTransformAes192CbcId: - * + * * The AES192 CBC cipher transform klass. */ #define xmlSecMSCryptoTransformAes192CbcId \ - xmlSecMSCryptoTransformAes192CbcGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformAes192CbcGetKlass(void); + xmlSecMSCryptoTransformAes192CbcGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformAes192CbcGetKlass(void); /** * xmlSecMSCryptoTransformAes256CbcId: - * + * * The AES256 CBC cipher transform klass. */ #define xmlSecMSCryptoTransformAes256CbcId \ - xmlSecMSCryptoTransformAes256CbcGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformAes256CbcGetKlass(void); - -/** - * xmlSecMSCryptoTransformKWAes128Id: - * - * The AES 128 key wrap transform klass. - */ -#define xmlSecMSCryptoTransformKWAes128Id \ - xmlSecMSCryptoTransformKWAes128GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformKWAes128GetKlass(void); - -/** - * xmlSecMSCryptoTransformKWAes192Id: - * - * The AES 192 key wrap transform klass. - */ -#define xmlSecMSCryptoTransformKWAes192Id \ - xmlSecMSCryptoTransformKWAes192GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformKWAes192GetKlass(void); - -/** - * xmlSecMSCryptoTransformKWAes256Id: - * - * The AES 256 key wrap transform klass. - */ -#define xmlSecMSCryptoTransformKWAes256Id \ - xmlSecMSCryptoTransformKWAes256GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformKWAes256GetKlass(void); + xmlSecMSCryptoTransformAes256CbcGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformAes256CbcGetKlass(void); #endif /* XMLSEC_NO_AES */ @@ -400,112 +243,25 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformKWAes256GetKlass( /** * xmlSecMSCryptoKeyDataDesId: - * + * * The DES key data klass. */ #define xmlSecMSCryptoKeyDataDesId \ - xmlSecMSCryptoKeyDataDesGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataDesGetKlass(void); + xmlSecMSCryptoKeyDataDesGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataDesGetKlass(void); /** * xmlSecMSCryptoTransformDes3CbcId: - * + * * The DES3 CBC cipher transform klass. */ #define xmlSecMSCryptoTransformDes3CbcId \ - xmlSecMSCryptoTransformDes3CbcGetKlass() + xmlSecMSCryptoTransformDes3CbcGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformDes3CbcGetKlass(void); -/** - * xmlSecMSCryptoTransformKWDes3Id: - * - * The DES3 KW transform klass. - */ -#define xmlSecMSCryptoTransformKWDes3Id \ - xmlSecMSCryptoTransformKWDes3GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformKWDes3GetKlass(void); -#endif /* XMLSEC_NO_DES */ - - -/******************************************************************** - * - * HMAC transforms - * - *******************************************************************/ -#ifndef XMLSEC_NO_HMAC - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoHmacGetMinOutputLength(void); -XMLSEC_CRYPTO_EXPORT void xmlSecMSCryptoHmacSetMinOutputLength(int min_length); - -/** - * xmlSecMSCryptoKeyDataHmacId: - * - * The DHMAC key klass. - */ -#define xmlSecMSCryptoKeyDataHmacId \ - xmlSecMSCryptoKeyDataHmacGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataHmacGetKlass(void); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataHmacSet (xmlSecKeyDataPtr data, - const xmlSecByte* buf, - xmlSecSize bufSize); - -#ifndef XMLSEC_NO_MD5 -/** - * xmlSecMSCryptoTransformHmacMd5Id: - * - * The HMAC with MD5 signature transform klass. - */ -#define xmlSecMSCryptoTransformHmacMd5Id \ - xmlSecMSCryptoTransformHmacMd5GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformHmacMd5GetKlass(void); -#endif /* XMLSEC_NO_MD5 */ - -#ifndef XMLSEC_NO_SHA1 -/** - * xmlSecMSCryptoTransformHmacSha1Id: - * - * The HMAC with SHA1 signature transform klass. - */ -#define xmlSecMSCryptoTransformHmacSha1Id \ - xmlSecMSCryptoTransformHmacSha1GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformHmacSha1GetKlass(void); -#endif /* XMLSEC_NO_SHA1 */ -#ifndef XMLSEC_NO_SHA256 -/** - * xmlSecMSCryptoTransformHmacSha256Id: - * - * The HMAC with SHA256 signature transform klass. - */ -#define xmlSecMSCryptoTransformHmacSha256Id \ - xmlSecMSCryptoTransformHmacSha256GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformHmacSha256GetKlass(void); -#endif /* XMLSEC_NO_SHA256 */ - -#ifndef XMLSEC_NO_SHA384 -/** - * xmlSecMSCryptoTransformHmacSha384Id: - * - * The HMAC with SHA384 signature transform klass. - */ -#define xmlSecMSCryptoTransformHmacSha384Id \ - xmlSecMSCryptoTransformHmacSha384GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformHmacSha384GetKlass(void); -#endif /* XMLSEC_NO_SHA384 */ - -#ifndef XMLSEC_NO_SHA512 -/** - * xmlSecMSCryptoTransformHmacSha512Id: - * - * The HMAC with SHA512 signature transform klass. - */ -#define xmlSecMSCryptoTransformHmacSha512Id \ - xmlSecMSCryptoTransformHmacSha512GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformHmacSha512GetKlass(void); -#endif /* XMLSEC_NO_SHA512 */ - -#endif /* XMLSEC_NO_HMAC */ +#endif /* XMLSEC_NO_DES */ #ifdef __cplusplus } @@ -513,4 +269,4 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecMSCryptoTransformHmacSha512GetKlass #endif /* __XMLSEC_MSCRYPTO_CRYPTO_H__ */ -#define __XMLSEC_MSCRYPTO_CRYPTO_H__ +#define __XMLSEC_MSCRYPTO_CRYPTO_H__ diff --git a/include/xmlsec/mscrypto/keysstore.h b/include/xmlsec/mscrypto/keysstore.h index afaf6a95..ab66547f 100644 --- a/include/xmlsec/mscrypto/keysstore.h +++ b/include/xmlsec/mscrypto/keysstore.h @@ -1,19 +1,19 @@ -/** +/** * XMLSec library - * + * * MSCrypto keys store - * + * * This is free software; see Copyright file in the source * distribution for precise wording. - * - * Copyright (C) 2003 Cordys R&D BV, All rights reserved. + * + * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved. */ #ifndef __XMLSEC_MSCRYPTO_KEYSSTORE_H__ -#define __XMLSEC_MSCRYPTO_KEYSSTORE_H__ +#define __XMLSEC_MSCRYPTO_KEYSSTORE_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <xmlsec/xmlsec.h> @@ -27,18 +27,16 @@ extern "C" { * * A MSCrypto keys store klass id. */ -#define xmlSecMSCryptoKeysStoreId xmlSecMSCryptoKeysStoreGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecMSCryptoKeysStoreGetKlass (void); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysStoreAdoptKey (xmlSecKeyStorePtr store, - xmlSecKeyPtr key); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysStoreLoad (xmlSecKeyStorePtr store, - const char *uri, - xmlSecKeysMngrPtr keysMngr); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysStoreSave (xmlSecKeyStorePtr store, - const char *filename, - xmlSecKeyDataType type); - - +#define xmlSecMSCryptoKeysStoreId xmlSecMSCryptoKeysStoreGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecMSCryptoKeysStoreGetKlass (void); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysStoreAdoptKey (xmlSecKeyStorePtr store, + xmlSecKeyPtr key); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysStoreLoad (xmlSecKeyStorePtr store, + const char *uri, + xmlSecKeysMngrPtr keysMngr); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeysStoreSave (xmlSecKeyStorePtr store, + const char *filename, + xmlSecKeyDataType type); #ifdef __cplusplus } diff --git a/include/xmlsec/mscrypto/symbols.h b/include/xmlsec/mscrypto/symbols.h index 17000ccf..2f8ceb43 100644 --- a/include/xmlsec/mscrypto/symbols.h +++ b/include/xmlsec/mscrypto/symbols.h @@ -1,13 +1,13 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * - * Copyright (C) 2003 Cordys R&D BV, All rights reserved. + * + * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved. */ #ifndef __XMLSEC_MSCRYPTO_SYMBOLS_H__ -#define __XMLSEC_MSCRYPTO_SYMBOLS_H__ +#define __XMLSEC_MSCRYPTO_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,92 +15,80 @@ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ +/** + * Defines for writing simple code + */ #ifdef XMLSEC_CRYPTO_MSCRYPTO -/******************************************************************** - * +/** * Crypto Init/shutdown - * - ********************************************************************/ -#define xmlSecCryptoInit xmlSecMSCryptoInit -#define xmlSecCryptoShutdown xmlSecMSCryptoShutdown + */ +#define xmlSecCryptoInit xmlSecMSCryptoInit +#define xmlSecCryptoShutdown xmlSecMSCryptoShutdown -#define xmlSecCryptoKeysMngrInit xmlSecMSCryptoKeysMngrInit +#define xmlSecCryptoKeysMngrInit xmlSecMSCryptoKeysMngrInit -/******************************************************************** - * +/** * Key data ids - * - ********************************************************************/ -#define xmlSecKeyDataAesId xmlSecMSCryptoKeyDataAesId -#define xmlSecKeyDataDesId xmlSecMSCryptoKeyDataDesId -#define xmlSecKeyDataDsaId xmlSecMSCryptoKeyDataDsaId -#define xmlSecKeyDataGost2001Id xmlSecMSCryptoKeyDataGost2001Id -#define xmlSecKeyDataHmacId xmlSecMSCryptoKeyDataHmacId -#define xmlSecKeyDataRsaId xmlSecMSCryptoKeyDataRsaId -#define xmlSecKeyDataX509Id xmlSecMSCryptoKeyDataX509Id -#define xmlSecKeyDataRawX509CertId xmlSecMSCryptoKeyDataRawX509CertId + */ +#define xmlSecKeyDataAesId xmlSecMSCryptoKeyDataAesId +#define xmlSecKeyDataDesId xmlSecMSCryptoKeyDataDesId +#define xmlSecKeyDataDsaId xmlSecMSCryptoKeyDataDsaId +#define xmlSecKeyDataGost2001Id xmlSecMSCryptoKeyDataGost2001Id +#define xmlSecKeyDataHmacId xmlSecMSCryptoKeyDataHmacId +#define xmlSecKeyDataRsaId xmlSecMSCryptoKeyDataRsaId +#define xmlSecKeyDataX509Id xmlSecMSCryptoKeyDataX509Id +#define xmlSecKeyDataRawX509CertId xmlSecMSCryptoKeyDataRawX509CertId -/******************************************************************** - * +/** * Key data store ids - * - ********************************************************************/ -#define xmlSecX509StoreId xmlSecMSCryptoX509StoreId + */ +#define xmlSecX509StoreId xmlSecMSCryptoX509StoreId -/******************************************************************** - * +/** * Crypto transforms ids - * - ********************************************************************/ -#define xmlSecTransformAes128CbcId xmlSecMSCryptoTransformAes128CbcId -#define xmlSecTransformAes192CbcId xmlSecMSCryptoTransformAes192CbcId -#define xmlSecTransformAes256CbcId xmlSecMSCryptoTransformAes256CbcId -#define xmlSecTransformKWAes128Id xmlSecMSCryptoTransformKWAes128Id -#define xmlSecTransformKWAes192Id xmlSecMSCryptoTransformKWAes192Id -#define xmlSecTransformKWAes256Id xmlSecMSCryptoTransformKWAes256Id -#define xmlSecTransformDes3CbcId xmlSecMSCryptoTransformDes3CbcId -#define xmlSecTransformKWDes3Id xmlSecMSCryptoTransformKWDes3Id -#define xmlSecTransformDsaSha1Id xmlSecMSCryptoTransformDsaSha1Id -#define xmlSecTransformGost2001GostR3411_94Id xmlSecMSCryptoTransformGost2001GostR3411_94Id -#define xmlSecTransformHmacMd5Id xmlSecMSCryptoTransformHmacMd5Id -#define xmlSecTransformHmacRipemd160Id xmlSecMSCryptoTransformHmacRipemd160Id -#define xmlSecTransformHmacSha1Id xmlSecMSCryptoTransformHmacSha1Id -#define xmlSecTransformRipemd160Id xmlSecMSCryptoTransformRipemd160Id -#define xmlSecTransformRsaSha1Id xmlSecMSCryptoTransformRsaSha1Id -#define xmlSecTransformRsaSha256Id xmlSecMSCryptoTransformRsaSha256Id -#define xmlSecTransformRsaSha384Id xmlSecMSCryptoTransformRsaSha384Id -#define xmlSecTransformRsaSha512Id xmlSecMSCryptoTransformRsaSha512Id -#define xmlSecTransformRsaPkcs1Id xmlSecMSCryptoTransformRsaPkcs1Id -#define xmlSecTransformRsaOaepId xmlSecMSCryptoTransformRsaOaepId -#define xmlSecTransformSha1Id xmlSecMSCryptoTransformSha1Id -#define xmlSecTransformSha256Id xmlSecMSCryptoTransformSha256Id -#define xmlSecTransformSha384Id xmlSecMSCryptoTransformSha384Id -#define xmlSecTransformSha512Id xmlSecMSCryptoTransformSha512Id -#define xmlSecTransformGostR3411_94Id xmlSecMSCryptoTransformGostR3411_94Id + */ +#define xmlSecTransformAes128CbcId xmlSecMSCryptoTransformAes128CbcId +#define xmlSecTransformAes192CbcId xmlSecMSCryptoTransformAes192CbcId +#define xmlSecTransformAes256CbcId xmlSecMSCryptoTransformAes256CbcId +#define xmlSecTransformKWAes128Id xmlSecMSCryptoTransformKWAes128Id +#define xmlSecTransformKWAes192Id xmlSecMSCryptoTransformKWAes192Id +#define xmlSecTransformKWAes256Id xmlSecMSCryptoTransformKWAes256Id +#define xmlSecTransformDes3CbcId xmlSecMSCryptoTransformDes3CbcId +#define xmlSecTransformKWDes3Id xmlSecMSCryptoTransformKWDes3Id +#define xmlSecTransformDsaSha1Id xmlSecMSCryptoTransformDsaSha1Id +#define xmlSecTransformGost2001GostR3411_94Id xmlSecMSCryptoTransformGost2001GostR3411_94Id +#define xmlSecTransformHmacMd5Id xmlSecMSCryptoTransformHmacMd5Id +#define xmlSecTransformHmacRipemd160Id xmlSecMSCryptoTransformHmacRipemd160Id +#define xmlSecTransformHmacSha1Id xmlSecMSCryptoTransformHmacSha1Id +#define xmlSecTransformRipemd160Id xmlSecMSCryptoTransformRipemd160Id +#define xmlSecTransformRsaSha1Id xmlSecMSCryptoTransformRsaSha1Id +#define xmlSecTransformRsaPkcs1Id xmlSecMSCryptoTransformRsaPkcs1Id +#define xmlSecTransformRsaOaepId xmlSecMSCryptoTransformRsaOaepId +#define xmlSecTransformSha1Id xmlSecMSCryptoTransformSha1Id +#define xmlSecTransformGostR3411_94Id xmlSecMSCryptoTransformGostR3411_94Id -/******************************************************************** - * +/** * High level routines form xmlsec command line utility - * - ********************************************************************/ -#define xmlSecCryptoAppInit xmlSecMSCryptoAppInit -#define xmlSecCryptoAppShutdown xmlSecMSCryptoAppShutdown -#define xmlSecCryptoAppDefaultKeysMngrInit xmlSecMSCryptoAppDefaultKeysMngrInit -#define xmlSecCryptoAppDefaultKeysMngrAdoptKey xmlSecMSCryptoAppDefaultKeysMngrAdoptKey -#define xmlSecCryptoAppDefaultKeysMngrLoad xmlSecMSCryptoAppDefaultKeysMngrLoad -#define xmlSecCryptoAppDefaultKeysMngrSave xmlSecMSCryptoAppDefaultKeysMngrSave -#define xmlSecCryptoAppKeysMngrCertLoad xmlSecMSCryptoAppKeysMngrCertLoad -#define xmlSecCryptoAppKeysMngrCertLoadMemory xmlSecMSCryptoAppKeysMngrCertLoadMemory -#define xmlSecCryptoAppKeyLoad xmlSecMSCryptoAppKeyLoad -#define xmlSecCryptoAppPkcs12Load xmlSecMSCryptoAppPkcs12Load -#define xmlSecCryptoAppKeyCertLoad xmlSecMSCryptoAppKeyCertLoad -#define xmlSecCryptoAppKeyLoadMemory xmlSecMSCryptoAppKeyLoadMemory -#define xmlSecCryptoAppPkcs12LoadMemory xmlSecMSCryptoAppPkcs12LoadMemory -#define xmlSecCryptoAppKeyCertLoadMemory xmlSecMSCryptoAppKeyCertLoadMemory -#define xmlSecCryptoAppGetDefaultPwdCallback xmlSecMSCryptoAppGetDefaultPwdCallback + */ + +#define xmlSecCryptoAppInit xmlSecMSCryptoAppInit +#define xmlSecCryptoAppShutdown xmlSecMSCryptoAppShutdown +#define xmlSecCryptoAppDefaultKeysMngrInit xmlSecMSCryptoAppDefaultKeysMngrInit +#define xmlSecCryptoAppDefaultKeysMngrAdoptKey xmlSecMSCryptoAppDefaultKeysMngrAdoptKey +#define xmlSecCryptoAppDefaultKeysMngrLoad xmlSecMSCryptoAppDefaultKeysMngrLoad +#define xmlSecCryptoAppDefaultKeysMngrSave xmlSecMSCryptoAppDefaultKeysMngrSave +#define xmlSecCryptoAppKeysMngrCertLoad xmlSecMSCryptoAppKeysMngrCertLoad +#define xmlSecCryptoAppKeysMngrCertLoadMemory xmlSecMSCryptoAppKeysMngrCertLoadMemory +#define xmlSecCryptoAppKeyLoad xmlSecMSCryptoAppKeyLoad +#define xmlSecCryptoAppPkcs12Load xmlSecMSCryptoAppPkcs12Load +#define xmlSecCryptoAppKeyCertLoad xmlSecMSCryptoAppKeyCertLoad +#define xmlSecCryptoAppKeyLoadMemory xmlSecMSCryptoAppKeyLoadMemory +#define xmlSecCryptoAppPkcs12LoadMemory xmlSecMSCryptoAppPkcs12LoadMemory +#define xmlSecCryptoAppKeyCertLoadMemory xmlSecMSCryptoAppKeyCertLoadMemory +#define xmlSecCryptoAppGetDefaultPwdCallback xmlSecMSCryptoAppGetDefaultPwdCallback #endif /* XMLSEC_CRYPTO_MSCRYPTO */ @@ -110,5 +98,5 @@ extern "C" { #endif /* __XMLSEC_MSCRYPTO_CRYPTO_H__ */ -#define __XMLSEC_MSCRYPTO_CRYPTO_H__ +#define __XMLSEC_MSCRYPTO_CRYPTO_H__ diff --git a/include/xmlsec/mscrypto/x509.h b/include/xmlsec/mscrypto/x509.h index 60066bda..4dd72d0c 100644 --- a/include/xmlsec/mscrypto/x509.h +++ b/include/xmlsec/mscrypto/x509.h @@ -1,17 +1,17 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * - * Copyright (C) 2003 Cordys R&D BV, All rights reserved. + * + * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved. */ #ifndef __XMLSEC_MSCRYPTO_X509_H__ -#define __XMLSEC_MSCRYPTO_X509_H__ +#define __XMLSEC_MSCRYPTO_X509_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #ifndef XMLSEC_NO_X509 @@ -24,64 +24,81 @@ extern "C" { /** * xmlSecMSCryptoKeyDataX509Id: - * + * * The MSCrypto X509 data klass. */ #define xmlSecMSCryptoKeyDataX509Id \ - xmlSecMSCryptoKeyDataX509GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataX509GetKlass(void); + xmlSecMSCryptoKeyDataX509GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataX509GetKlass(void); -XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoKeyDataX509GetKeyCert (xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataX509AdoptKeyCert (xmlSecKeyDataPtr data, - PCCERT_CONTEXT cert); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataX509AdoptCert (xmlSecKeyDataPtr data, - PCCERT_CONTEXT cert); -XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoKeyDataX509GetCert (xmlSecKeyDataPtr data, - xmlSecSize pos); -XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecMSCryptoKeyDataX509GetCertsSize (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoKeyDataX509GetKeyCert (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataX509AdoptKeyCert (xmlSecKeyDataPtr data, + PCCERT_CONTEXT cert); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataX509AdoptCert (xmlSecKeyDataPtr data, + PCCERT_CONTEXT cert); +XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoKeyDataX509GetCert (xmlSecKeyDataPtr data, + xmlSecSize pos); +XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecMSCryptoKeyDataX509GetCertsSize (xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataX509AdoptCrl (xmlSecKeyDataPtr data, - PCCRL_CONTEXT crl); -XMLSEC_CRYPTO_EXPORT PCCRL_CONTEXT xmlSecMSCryptoKeyDataX509GetCrl (xmlSecKeyDataPtr data, - xmlSecSize pos); -XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecMSCryptoKeyDataX509GetCrlsSize (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoKeyDataX509AdoptCrl (xmlSecKeyDataPtr data, + PCCRL_CONTEXT crl); +XMLSEC_CRYPTO_EXPORT PCCRL_CONTEXT xmlSecMSCryptoKeyDataX509GetCrl (xmlSecKeyDataPtr data, + xmlSecSize pos); +XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecMSCryptoKeyDataX509GetCrlsSize (xmlSecKeyDataPtr data); /** * xmlSecMSCryptoKeyDataRawX509CertId: - * + * * The MSCrypto raw X509 certificate klass. */ #define xmlSecMSCryptoKeyDataRawX509CertId \ - xmlSecMSCryptoKeyDataRawX509CertGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataRawX509CertGetKlass(void); + xmlSecMSCryptoKeyDataRawX509CertGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecMSCryptoKeyDataRawX509CertGetKlass(void); /** * xmlSecMSCryptoX509StoreId: - * + * * The MSCrypto X509 store klass. */ #define xmlSecMSCryptoX509StoreId \ - xmlSecMSCryptoX509StoreGetKlass() + xmlSecMSCryptoX509StoreGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecKeyDataStoreId xmlSecMSCryptoX509StoreGetKlass(void); -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptCert (xmlSecKeyDataStorePtr store, - PCCERT_CONTEXT cert, - xmlSecKeyDataType type); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptKeyStore (xmlSecKeyDataStorePtr store, - HCERTSTORE keyStore); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptTrustedStore(xmlSecKeyDataStorePtr store, - HCERTSTORE trustedStore); - -XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptUntrustedStore(xmlSecKeyDataStorePtr store, - HCERTSTORE untrustedStore); - -XMLSEC_CRYPTO_EXPORT void xmlSecMSCryptoX509StoreEnableSystemTrustedCerts(xmlSecKeyDataStorePtr store, - int val); - - +XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoX509StoreFindCert (xmlSecKeyDataStorePtr store, + xmlChar *subjectName, + xmlChar *issuerName, + xmlChar *issuerSerial, + xmlChar *ski, + xmlSecKeyInfoCtx* keyInfoCtx); + + +XMLSEC_CRYPTO_EXPORT PCCERT_CONTEXT xmlSecMSCryptoX509StoreVerify (xmlSecKeyDataStorePtr store, + HCERTSTORE certs, + xmlSecKeyInfoCtx* keyInfoCtx); +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptCert (xmlSecKeyDataStorePtr store, + PCCERT_CONTEXT cert, + xmlSecKeyDataType type); + +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptKeyStore ( + xmlSecKeyDataStorePtr store, + HCERTSTORE keyStore + ) ; + +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptTrustedStore ( + xmlSecKeyDataStorePtr store, + HCERTSTORE trustedStore + ) ; + +XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptUntrustedStore ( + xmlSecKeyDataStorePtr store, + HCERTSTORE untrustedStore + ) ; + +XMLSEC_CRYPTO_EXPORT void xmlSecMSCryptoX509StoreEnableSystemTrustedCerts ( + xmlSecKeyDataStorePtr store, + int val + ) ; #endif /* XMLSEC_NO_X509 */ |