diff options
Diffstat (limited to 'include/xmlsec/nss')
-rw-r--r-- | include/xmlsec/nss/Makefile.in | 59 | ||||
-rw-r--r-- | include/xmlsec/nss/app.h | 156 | ||||
-rw-r--r-- | include/xmlsec/nss/bignum.h | 26 | ||||
-rw-r--r-- | include/xmlsec/nss/crypto.h | 350 | ||||
-rw-r--r-- | include/xmlsec/nss/keysstore.h | 32 | ||||
-rw-r--r-- | include/xmlsec/nss/pkikeys.h | 22 | ||||
-rw-r--r-- | include/xmlsec/nss/symbols.h | 129 | ||||
-rw-r--r-- | include/xmlsec/nss/x509.h | 76 |
8 files changed, 524 insertions, 326 deletions
diff --git a/include/xmlsec/nss/Makefile.in b/include/xmlsec/nss/Makefile.in index cd99f9db..8f7952d3 100644 --- a/include/xmlsec/nss/Makefile.in +++ b/include/xmlsec/nss/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -38,13 +38,22 @@ subdir = include/xmlsec/nss DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(xmlsecnssinc_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in +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__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -68,6 +77,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(xmlsecnssincdir)" HEADERS = $(xmlsecnssinc_HEADERS) ETAGS = etags @@ -75,6 +90,7 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -89,6 +105,7 @@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -97,6 +114,10 @@ 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@ @@ -127,6 +148,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOZILLA_MIN_VERSION = @MOZILLA_MIN_VERSION@ MSCRYPTO_CFLAGS = @MSCRYPTO_CFLAGS@ @@ -158,8 +180,10 @@ 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_ENABLED = @PKG_CONFIG_ENABLED@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RM = @RM@ SED = @SED@ @@ -167,7 +191,6 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ -U = @U@ VERSION = @VERSION@ XMLSEC_APP_DEFINES = @XMLSEC_APP_DEFINES@ XMLSEC_CFLAGS = @XMLSEC_CFLAGS@ @@ -186,6 +209,8 @@ 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@ @@ -195,6 +220,7 @@ 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@ @@ -230,6 +256,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -262,7 +289,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -346,9 +372,7 @@ uninstall-xmlsecnssincHEADERS: @$(NORMAL_UNINSTALL) @list='$(xmlsecnssinc_HEADERS)'; test -n "$(xmlsecnssincdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(xmlsecnssincdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(xmlsecnssincdir)" && rm -f $$files + dir='$(DESTDIR)$(xmlsecnssincdir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -449,10 +473,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/include/xmlsec/nss/app.h b/include/xmlsec/nss/app.h index b78492ff..387d34ec 100644 --- a/include/xmlsec/nss/app.h +++ b/include/xmlsec/nss/app.h @@ -1,18 +1,18 @@ -/** +/** * 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> * Copyright (c) 2003 America Online, Inc. All rights reserved. */ #ifndef __XMLSEC_NSS_APP_H__ -#define __XMLSEC_NSS_APP_H__ +#define __XMLSEC_NSS_APP_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <nspr.h> #include <nss.h> @@ -22,87 +22,93 @@ extern "C" { #include <xmlsec/keysmngr.h> #include <xmlsec/transforms.h> -/** +/******************************************************************** + * * Init/shutdown - */ -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppInit (const char* config); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppShutdown (void); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppInit (const char* config); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppShutdown (void); -/** +/******************************************************************** + * * Keys Manager - */ -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr, - xmlSecKeyPtr key); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, - const char* uri); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, - const char* filename, - xmlSecKeyDataType type); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr, + xmlSecKeyPtr key); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, + const char* uri); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, + const char* filename, + xmlSecKeyDataType type); #ifndef XMLSEC_NO_X509 -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, - const char *filename, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeysMngrCertLoadMemory(xmlSecKeysMngrPtr mngr, - const xmlSecByte *data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeysMngrCertLoadSECItem(xmlSecKeysMngrPtr mngr, - SECItem* secItem, - xmlSecKeyDataFormat format, - xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, + const char *filename, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeysMngrCertLoadMemory(xmlSecKeysMngrPtr mngr, + const xmlSecByte *data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeysMngrCertLoadSECItem(xmlSecKeysMngrPtr mngr, + SECItem* secItem, + xmlSecKeyDataFormat format, + xmlSecKeyDataType type); #endif /* XMLSEC_NO_X509 */ -/** +/******************************************************************** + * * Keys - */ -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyLoad (const char *filename, - xmlSecKeyDataFormat format, - const char *pwd, - void *pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyLoadMemory (const xmlSecByte *data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format, - const char *pwd, - void *pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyLoadSECItem (SECItem* secItem, - xmlSecKeyDataFormat format, - const char *pwd, - void *pwdCallback, - void* pwdCallbackCtx); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyLoad (const char *filename, + xmlSecKeyDataFormat format, + const char *pwd, + void *pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyLoadMemory (const xmlSecByte *data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format, + const char *pwd, + void *pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyLoadSECItem (SECItem* secItem, + xmlSecKeyDataFormat format, + const char *pwd, + void *pwdCallback, + void* pwdCallbackCtx); #ifndef XMLSEC_NO_X509 -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppPkcs12Load (const char *filename, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppPkcs12LoadMemory (const xmlSecByte *data, - xmlSecSize dataSize, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppPkcs12LoadSECItem (SECItem* secItem, - const char *pwd, - void* pwdCallback, - void* pwdCallbackCtx); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeyCertLoad (xmlSecKeyPtr key, - const char* filename, - xmlSecKeyDataFormat format); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeyCertLoadMemory (xmlSecKeyPtr key, - const xmlSecByte *data, - xmlSecSize dataSize, - xmlSecKeyDataFormat format); -XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeyCertLoadSECItem (xmlSecKeyPtr key, - SECItem* secItem, - xmlSecKeyDataFormat format); -XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyFromCertLoadSECItem(SECItem* secItem, - xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppPkcs12Load (const char *filename, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppPkcs12LoadMemory (const xmlSecByte *data, + xmlSecSize dataSize, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppPkcs12LoadSECItem (SECItem* secItem, + const char *pwd, + void* pwdCallback, + void* pwdCallbackCtx); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeyCertLoad (xmlSecKeyPtr key, + const char* filename, + xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeyCertLoadMemory (xmlSecKeyPtr key, + const xmlSecByte *data, + xmlSecSize dataSize, + xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT int xmlSecNssAppKeyCertLoadSECItem (xmlSecKeyPtr key, + SECItem* secItem, + xmlSecKeyDataFormat format); +XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecNssAppKeyFromCertLoadSECItem(SECItem* secItem, + xmlSecKeyDataFormat format); #endif /* XMLSEC_NO_X509 */ -XMLSEC_CRYPTO_EXPORT void* xmlSecNssAppGetDefaultPwdCallback(void); +XMLSEC_CRYPTO_EXPORT void* xmlSecNssAppGetDefaultPwdCallback(void); #ifdef __cplusplus } diff --git a/include/xmlsec/nss/bignum.h b/include/xmlsec/nss/bignum.h index b5d98bc0..6147d20a 100644 --- a/include/xmlsec/nss/bignum.h +++ b/include/xmlsec/nss/bignum.h @@ -1,33 +1,33 @@ -/** +/** * XMLSec library - * + * * Reading/writing BIGNUM values - * + * * This is free software; see Copyright file in the source * distribution for precise wording. - * + * * Copyright (c) 2003 America Online, Inc. All rights reserved. */ #ifndef __XMLSEC_NSS_BIGNUM_H__ -#define __XMLSEC_NSS_BIGNUM_H__ +#define __XMLSEC_NSS_BIGNUM_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#include <libxml/tree.h> +#include <libxml/tree.h> #include <nspr.h> #include <nss.h> #include <xmlsec/xmlsec.h> -XMLSEC_CRYPTO_EXPORT SECItem* xmlSecNssNodeGetBigNumValue (PRArenaPool *arena, - const xmlNodePtr cur, - SECItem *a); -XMLSEC_CRYPTO_EXPORT int xmlSecNssNodeSetBigNumValue (xmlNodePtr cur, - const SECItem *a, - int addLineBreaks); +XMLSEC_CRYPTO_EXPORT SECItem* xmlSecNssNodeGetBigNumValue (PRArenaPool *arena, + const xmlNodePtr cur, + SECItem *a); +XMLSEC_CRYPTO_EXPORT int xmlSecNssNodeSetBigNumValue (xmlNodePtr cur, + const SECItem *a, + int addLineBreaks); #ifdef __cplusplus } diff --git a/include/xmlsec/nss/crypto.h b/include/xmlsec/nss/crypto.h index 42ba6ca9..a1c11948 100644 --- a/include/xmlsec/nss/crypto.h +++ b/include/xmlsec/nss/crypto.h @@ -1,18 +1,18 @@ -/** +/** * 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> * Copyright (c) 2003 America Online, Inc. All rights reserved. */ #ifndef __XMLSEC_NSS_CRYPTO_H__ -#define __XMLSEC_NSS_CRYPTO_H__ +#define __XMLSEC_NSS_CRYPTO_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <nspr.h> #include <nss.h> @@ -23,25 +23,27 @@ extern "C" { #include <xmlsec/transforms.h> #include <xmlsec/dl.h> -XMLSEC_CRYPTO_EXPORT xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_nss(void); +XMLSEC_CRYPTO_EXPORT xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_nss(void); -/** +/******************************************************************** + * * Init shutdown - */ -XMLSEC_CRYPTO_EXPORT int xmlSecNssInit (void); -XMLSEC_CRYPTO_EXPORT int xmlSecNssShutdown (void); - -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysMngrInit (xmlSecKeysMngrPtr mngr); -XMLSEC_CRYPTO_EXPORT int xmlSecNssGenerateRandom (xmlSecBufferPtr buffer, - xmlSecSize size); - -XMLSEC_CRYPTO_EXPORT void xmlSecNssErrorsDefaultCallback (const char* file, - int line, - const char* func, - const char* errorObject, - const char* errorSubject, - int reason, - const char* msg); + * + ********************************************************************/ +XMLSEC_CRYPTO_EXPORT int xmlSecNssInit (void); +XMLSEC_CRYPTO_EXPORT int xmlSecNssShutdown (void); + +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysMngrInit (xmlSecKeysMngrPtr mngr); +XMLSEC_CRYPTO_EXPORT int xmlSecNssGenerateRandom (xmlSecBufferPtr buffer, + xmlSecSize size); + +XMLSEC_CRYPTO_EXPORT void xmlSecNssErrorsDefaultCallback (const char* file, + int line, + const char* func, + const char* errorObject, + const char* errorSubject, + int reason, + const char* msg); XMLSEC_CRYPTO_EXPORT PK11SlotInfo * xmlSecNssGetInternalKeySlot(void); @@ -53,68 +55,68 @@ XMLSEC_CRYPTO_EXPORT PK11SlotInfo * xmlSecNssGetInternalKeySlot(void); #ifndef XMLSEC_NO_AES /** * xmlSecNssKeyDataAesId: - * + * * The AES key data klass. */ #define xmlSecNssKeyDataAesId \ - xmlSecNssKeyDataAesGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataAesGetKlass (void); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataAesSet (xmlSecKeyDataPtr data, - const xmlSecByte* buf, - xmlSecSize bufSize); + xmlSecNssKeyDataAesGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataAesGetKlass (void); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataAesSet (xmlSecKeyDataPtr data, + const xmlSecByte* buf, + xmlSecSize bufSize); /** * xmlSecNssTransformAes128CbcId: - * + * * The AES128 CBC cipher transform klass. */ #define xmlSecNssTransformAes128CbcId \ - xmlSecNssTransformAes128CbcGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes128CbcGetKlass(void); + xmlSecNssTransformAes128CbcGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes128CbcGetKlass(void); /** * xmlSecNssTransformAes192CbcId: - * + * * The AES192 CBC cipher transform klass. */ #define xmlSecNssTransformAes192CbcId \ - xmlSecNssTransformAes192CbcGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes192CbcGetKlass(void); + xmlSecNssTransformAes192CbcGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes192CbcGetKlass(void); /** * xmlSecNssTransformAes256CbcId: - * + * * The AES256 CBC cipher transform klass. */ #define xmlSecNssTransformAes256CbcId \ - xmlSecNssTransformAes256CbcGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes256CbcGetKlass(void); + xmlSecNssTransformAes256CbcGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformAes256CbcGetKlass(void); /** * xmlSecNssTransformKWAes128Id: - * + * * The AES 128 key wrap transform klass. */ #define xmlSecNssTransformKWAes128Id \ - xmlSecNssTransformKWAes128GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes128GetKlass(void); + xmlSecNssTransformKWAes128GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes128GetKlass(void); /** * xmlSecNssTransformKWAes192Id: - * + * * The AES 192 key wrap transform klass. */ #define xmlSecNssTransformKWAes192Id \ - xmlSecNssTransformKWAes192GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes192GetKlass(void); + xmlSecNssTransformKWAes192GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes192GetKlass(void); /** * xmlSecNssTransformKWAes256Id: - * + * * The AES 256 key wrap transform klass. */ #define xmlSecNssTransformKWAes256Id \ - xmlSecNssTransformKWAes256GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes256GetKlass(void); + xmlSecNssTransformKWAes256GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes256GetKlass(void); #endif /* XMLSEC_NO_AES */ @@ -126,32 +128,32 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWAes256GetKlass(void); #ifndef XMLSEC_NO_DES /** * xmlSecNssKeyDataDesId: - * + * * The DES key data klass. */ #define xmlSecNssKeyDataDesId \ - xmlSecNssKeyDataDesGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataDesGetKlass (void); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataDesSet (xmlSecKeyDataPtr data, - const xmlSecByte* buf, - xmlSecSize bufSize); + xmlSecNssKeyDataDesGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataDesGetKlass (void); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataDesSet (xmlSecKeyDataPtr data, + const xmlSecByte* buf, + xmlSecSize bufSize); /** * xmlSecNssTransformDes3CbcId: - * + * * The Triple DES CBC cipher transform klass. */ #define xmlSecNssTransformDes3CbcId \ - xmlSecNssTransformDes3CbcGetKlass() + xmlSecNssTransformDes3CbcGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformDes3CbcGetKlass(void); /** * xmlSecNssTransformKWDes3Id: -* -* The DES3 CBC cipher transform klass. -*/ +* +* The DES3 KW transform klass. +*/ #define xmlSecNssTransformKWDes3Id \ - xmlSecNssTransformKWDes3GetKlass() + xmlSecNssTransformKWDes3GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWDes3GetKlass(void); @@ -166,20 +168,20 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformKWDes3GetKlass(void); /** * xmlSecNssKeyDataDsaId: - * + * * The DSA key klass. */ #define xmlSecNssKeyDataDsaId \ - xmlSecNssKeyDataDsaGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataDsaGetKlass (void); + xmlSecNssKeyDataDsaGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataDsaGetKlass (void); /** * xmlSecNssTransformDsaSha1Id: - * + * * The DSA SHA1 signature transform klass. */ #define xmlSecNssTransformDsaSha1Id \ - xmlSecNssTransformDsaSha1GetKlass() + xmlSecNssTransformDsaSha1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformDsaSha1GetKlass(void); #endif /* XMLSEC_NO_DSA */ @@ -195,43 +197,82 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformDsaSha1GetKlass(void); XMLSEC_CRYPTO_EXPORT int xmlSecNssHmacGetMinOutputLength(void); XMLSEC_CRYPTO_EXPORT void xmlSecNssHmacSetMinOutputLength(int min_length); -/** +/** * xmlSecNssKeyDataHmacId: - * + * * The DHMAC key data klass. */ #define xmlSecNssKeyDataHmacId \ - xmlSecNssKeyDataHmacGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataHmacGetKlass (void); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataHmacSet (xmlSecKeyDataPtr data, - const xmlSecByte* buf, - xmlSecSize bufSize); + xmlSecNssKeyDataHmacGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataHmacGetKlass (void); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataHmacSet (xmlSecKeyDataPtr data, + const xmlSecByte* buf, + xmlSecSize bufSize); +#ifndef XMLSEC_NO_MD5 /** * xmlSecNssTransformHmacMd5Id: - * + * * The HMAC with MD5 signature transform klass. */ #define xmlSecNssTransformHmacMd5Id \ - xmlSecNssTransformHmacMd5GetKlass() + xmlSecNssTransformHmacMd5GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacMd5GetKlass(void); +#endif /* XMLSEC_NO_MD5 */ +#ifndef XMLSEC_NO_RIPEMD160 /** * xmlSecNssTransformHmacRipemd160Id: - * + * * The HMAC with RipeMD160 signature transform klass. */ #define xmlSecNssTransformHmacRipemd160Id \ - xmlSecNssTransformHmacRipemd160GetKlass() + xmlSecNssTransformHmacRipemd160GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacRipemd160GetKlass(void); +#endif /* XMLSEC_NO_RIPEMD160 */ +#ifndef XMLSEC_NO_SHA1 /** * xmlSecNssTransformHmacSha1Id: - * + * * The HMAC with SHA1 signature transform klass. */ #define xmlSecNssTransformHmacSha1Id \ - xmlSecNssTransformHmacSha1GetKlass() + xmlSecNssTransformHmacSha1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacSha1GetKlass(void); +#endif /* XMLSEC_NO_SHA1 */ + +#ifndef XMLSEC_NO_SHA256 +/** + * xmlSecNssTransformHmacSha256Id: + * + * The HMAC with SHA256 signature transform klass. + */ +#define xmlSecNssTransformHmacSha256Id \ + xmlSecNssTransformHmacSha256GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacSha256GetKlass(void); +#endif /* XMLSEC_NO_SHA256 */ + +#ifndef XMLSEC_NO_SHA384 +/** + * xmlSecNssTransformHmacSha384Id: + * + * The HMAC with SHA384 signature transform klass. + */ +#define xmlSecNssTransformHmacSha384Id \ + xmlSecNssTransformHmacSha384GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacSha384GetKlass(void); +#endif /* XMLSEC_NO_SHA384 */ + +#ifndef XMLSEC_NO_SHA512 +/** + * xmlSecNssTransformHmacSha512Id: + * + * The HMAC with SHA512 signature transform klass. + */ +#define xmlSecNssTransformHmacSha512Id \ + xmlSecNssTransformHmacSha512GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacSha512GetKlass(void); +#endif /* XMLSEC_NO_SHA512 */ #endif /* XMLSEC_NO_HMAC */ @@ -246,44 +287,92 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformHmacSha1GetKlass(void); /** * xmlSecNssKeyDataRsaId: - * + * * The RSA key klass. */ #define xmlSecNssKeyDataRsaId \ - xmlSecNssKeyDataRsaGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataRsaGetKlass (void); + xmlSecNssKeyDataRsaGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataRsaGetKlass (void); + +#ifndef XMLSEC_NO_MD5 +/** + * xmlSecNssTransformRsaMd5Id: + * + * The RSA-MD5 signature transform klass. + */ +#define xmlSecNssTransformRsaMd5Id \ + xmlSecNssTransformRsaMd5GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaMd5GetKlass(void); +#endif /* XMLSEC_NO_MD5 */ +#ifndef XMLSEC_NO_SHA1 /** * xmlSecNssTransformRsaSha1Id: - * + * * The RSA-SHA1 signature transform klass. */ -#define xmlSecNssTransformRsaSha1Id \ - xmlSecNssTransformRsaSha1GetKlass() +#define xmlSecNssTransformRsaSha1Id \ + xmlSecNssTransformRsaSha1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaSha1GetKlass(void); +#endif /* XMLSEC_NO_SHA1 */ + +#ifndef XMLSEC_NO_SHA256 +/** + * xmlSecNssTransformRsaSha256Id: + * + * The RSA-SHA256 signature transform klass. + */ +#define xmlSecNssTransformRsaSha256Id \ + xmlSecNssTransformRsaSha256GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaSha256GetKlass(void); +#endif /* XMLSEC_NO_SHA256 */ + +#ifndef XMLSEC_NO_SHA384 +/** + * xmlSecNssTransformRsaSha384Id: + * + * The RSA-SHA384 signature transform klass. + */ +#define xmlSecNssTransformRsaSha384Id \ + xmlSecNssTransformRsaSha384GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaSha384GetKlass(void); +#endif /* XMLSEC_NO_SHA384 */ + +#ifndef XMLSEC_NO_SHA512 +/** + * xmlSecNssTransformRsaSha512Id: + * + * The RSA-SHA512 signature transform klass. + */ +#define xmlSecNssTransformRsaSha512Id \ + xmlSecNssTransformRsaSha512GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaSha512GetKlass(void); +#endif /* XMLSEC_NO_SHA512 */ /** * xmlSecNssTransformRsaPkcs1Id: - * + * * The RSA PKCS1 key transport transform klass. */ #define xmlSecNssTransformRsaPkcs1Id \ xmlSecNssTransformRsaPkcs1GetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaPkcs1GetKlass(void); +/* aleksey, April 2010: NSS 3.12.6 has CKM_RSA_PKCS_OAEP algorithm but + it doesn't implement the SHA1 OAEP PKCS we need -/* RSA OAEP is not supported by NSS yet */ -#ifdef TODO
-/**
- * xmlSecNssTransformRsaOaepId:
- *
- * The RSA OAEP key transport transform klass.
- */
-
-#define xmlSecNssTransformRsaOaepId \
- xmlSecNssTransformRsaOaepGetKlass()
+ https://bugzilla.mozilla.org/show_bug.cgi?id=158747 +*/ +#ifdef XMLSEC_NSS_RSA_OAEP_TODO +/** + * xmlSecNssTransformRsaOaepId: + * + * The RSA OAEP key transport transform klass. + */ +#define xmlSecNssTransformRsaOaepId \ + xmlSecNssTransformRsaOaepGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaOaepGetKlass(void); -#endif /* TODO: RSA OAEP is not supported by NSS yet */ +#endif /* XMLSEC_NSS_RSA_OAEP_TODO */ #endif /* XMLSEC_NO_RSA */ @@ -296,18 +385,85 @@ XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaOaepGetKlass(void); #ifndef XMLSEC_NO_SHA1 /** * xmlSecNssTransformSha1Id: - * + * * The SHA1 digest transform klass. */ #define xmlSecNssTransformSha1Id \ - xmlSecNssTransformSha1GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformSha1GetKlass (void); + xmlSecNssTransformSha1GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformSha1GetKlass (void); #endif /* XMLSEC_NO_SHA1 */ +/******************************************************************** + * + * SHA256 transform + * + *******************************************************************/ +#ifndef XMLSEC_NO_SHA256 +/** + * xmlSecNssTransformSha256Id: + * + * The SHA256 digest transform klass. + */ +#define xmlSecNssTransformSha256Id \ + xmlSecNssTransformSha256GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformSha256GetKlass(void); +#endif /* XMLSEC_NO_SHA256 */ + +/******************************************************************** + * + * SHA384 transform + * + *******************************************************************/ +#ifndef XMLSEC_NO_SHA384 +/** + * xmlSecNssTransformSha384Id: + * + * The SHA384 digest transform klass. + */ +#define xmlSecNssTransformSha384Id \ + xmlSecNssTransformSha384GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformSha384GetKlass(void); +#endif /* XMLSEC_NO_SHA384 */ + +/******************************************************************** + * + * SHA512 transform + * + *******************************************************************/ +#ifndef XMLSEC_NO_SHA512 +/** + * xmlSecNssTransformSha512Id: + * + * The SHA512 digest transform klass. + */ +#define xmlSecNssTransformSha512Id \ + xmlSecNssTransformSha512GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformSha512GetKlass(void); +#endif /* XMLSEC_NO_SHA512 */ + +/******************************************************************** + * + * MD5 transforms + * + *******************************************************************/ +#ifndef XMLSEC_NO_MD5 +/** + * xmlSecNssTransformMd5Id: + * + * The MD5 digest transform klass. + */ +#define xmlSecNssTransformMd5Id \ + xmlSecNssTransformMd5GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformMd5GetKlass(void); +#endif /* XMLSEC_NO_MD5 */ + + + + #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __XMLSEC_NSS_CRYPTO_H__ */ -#define __XMLSEC_NSS_CRYPTO_H__ +#define __XMLSEC_NSS_CRYPTO_H__ diff --git a/include/xmlsec/nss/keysstore.h b/include/xmlsec/nss/keysstore.h index 10e6bb38..a2cc289b 100644 --- a/include/xmlsec/nss/keysstore.h +++ b/include/xmlsec/nss/keysstore.h @@ -1,19 +1,19 @@ -/** +/** * XMLSec library - * + * * Nss keys store - * + * * This is free software; see Copyright file in the source * distribution for precise wording. - * + * * Copyright (c) 2003 America Online, Inc. All rights reserved */ #ifndef __XMLSEC_NSS_KEYSSTORE_H__ -#define __XMLSEC_NSS_KEYSSTORE_H__ +#define __XMLSEC_NSS_KEYSSTORE_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <xmlsec/xmlsec.h> @@ -27,16 +27,16 @@ extern "C" { * * A Nss keys store klass id. */ -#define xmlSecNssKeysStoreId xmlSecNssKeysStoreGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecNssKeysStoreGetKlass (void); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKey (xmlSecKeyStorePtr store, - xmlSecKeyPtr key); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreLoad (xmlSecKeyStorePtr store, - const char *uri, - xmlSecKeysMngrPtr keysMngr); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreSave (xmlSecKeyStorePtr store, - const char *filename, - xmlSecKeyDataType type); +#define xmlSecNssKeysStoreId xmlSecNssKeysStoreGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecNssKeysStoreGetKlass (void); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKey (xmlSecKeyStorePtr store, + xmlSecKeyPtr key); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreLoad (xmlSecKeyStorePtr store, + const char *uri, + xmlSecKeysMngrPtr keysMngr); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreSave (xmlSecKeyStorePtr store, + const char *filename, + xmlSecKeyDataType type); #ifdef __cplusplus } diff --git a/include/xmlsec/nss/pkikeys.h b/include/xmlsec/nss/pkikeys.h index fd4a6e8a..cb498482 100644 --- a/include/xmlsec/nss/pkikeys.h +++ b/include/xmlsec/nss/pkikeys.h @@ -1,17 +1,17 @@ -/** +/** * XMLSec library * * This is free software; see Copyright file in the source * distribution for preciese wording. - * + * * Copyright (c) 2003 America Online, Inc. All rights reserved. */ #ifndef __XMLSEC_NSS_PKIKEYS_H__ -#define __XMLSEC_NSS_PKIKEYS_H__ +#define __XMLSEC_NSS_PKIKEYS_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include <nspr.h> #include <nss.h> @@ -21,17 +21,17 @@ extern "C" { #include <xmlsec/transforms.h> -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssPKIAdoptKey (SECKEYPrivateKey *privkey, - SECKEYPublicKey *pubkey); +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssPKIAdoptKey (SECKEYPrivateKey *privkey, + SECKEYPublicKey *pubkey); -XMLSEC_CRYPTO_EXPORT SECKEYPublicKey* xmlSecNssPKIKeyDataGetPubKey (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT SECKEYPublicKey* xmlSecNssPKIKeyDataGetPubKey (xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT SECKEYPrivateKey* xmlSecNssPKIKeyDataGetPrivKey (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT SECKEYPrivateKey* xmlSecNssPKIKeyDataGetPrivKey (xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT KeyType xmlSecNssPKIKeyDataGetKeyType (xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT KeyType xmlSecNssPKIKeyDataGetKeyType (xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT int xmlSecNssPKIKeyDataDuplicate (xmlSecKeyDataPtr dst, - xmlSecKeyDataPtr src); +XMLSEC_CRYPTO_EXPORT int xmlSecNssPKIKeyDataDuplicate (xmlSecKeyDataPtr dst, + xmlSecKeyDataPtr src); diff --git a/include/xmlsec/nss/symbols.h b/include/xmlsec/nss/symbols.h index b01a1fa1..9520cb83 100644 --- a/include/xmlsec/nss/symbols.h +++ b/include/xmlsec/nss/symbols.h @@ -1,14 +1,14 @@ -/** +/** * 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> * Copyright (c) 2003 America Online, Inc. All rights reserved. */ #ifndef __XMLSEC_NSS_SYMBOLS_H__ -#define __XMLSEC_NSS_SYMBOLS_H__ +#define __XMLSEC_NSS_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 @@ -17,76 +17,83 @@ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ -/** - * Defines for writing simple code - */ #ifdef XMLSEC_CRYPTO_NSS -/** +/******************************************************************** + * * Crypto Init/shutdown - */ -#define xmlSecCryptoInit xmlSecNssInit -#define xmlSecCryptoShutdown xmlSecNssShutdown + * + ********************************************************************/ +#define xmlSecCryptoInit xmlSecNssInit +#define xmlSecCryptoShutdown xmlSecNssShutdown -#define xmlSecCryptoKeysMngrInit xmlSecNssKeysMngrInit +#define xmlSecCryptoKeysMngrInit xmlSecNssKeysMngrInit -/** +/******************************************************************** + * * Key data ids - */ -#define xmlSecKeyDataAesId xmlSecNssKeyDataAesId -#define xmlSecKeyDataDesId xmlSecNssKeyDataDesId -#define xmlSecKeyDataDsaId xmlSecNssKeyDataDsaId -#define xmlSecKeyDataHmacId xmlSecNssKeyDataHmacId -#define xmlSecKeyDataRsaId xmlSecNssKeyDataRsaId -#define xmlSecKeyDataX509Id xmlSecNssKeyDataX509Id -#define xmlSecKeyDataRawX509CertId xmlSecNssKeyDataRawX509CertId + * + ********************************************************************/ +#define xmlSecKeyDataAesId xmlSecNssKeyDataAesId +#define xmlSecKeyDataDesId xmlSecNssKeyDataDesId +#define xmlSecKeyDataDsaId xmlSecNssKeyDataDsaId +#define xmlSecKeyDataHmacId xmlSecNssKeyDataHmacId +#define xmlSecKeyDataRsaId xmlSecNssKeyDataRsaId +#define xmlSecKeyDataX509Id xmlSecNssKeyDataX509Id +#define xmlSecKeyDataRawX509CertId xmlSecNssKeyDataRawX509CertId -/** +/******************************************************************** + * * Key data store ids - */ -#define xmlSecX509StoreId xmlSecNssX509StoreId + * + ********************************************************************/ +#define xmlSecX509StoreId xmlSecNssX509StoreId -/** +/******************************************************************** + * * Crypto transforms ids - */ -#define xmlSecTransformAes128CbcId xmlSecNssTransformAes128CbcId -#define xmlSecTransformAes192CbcId xmlSecNssTransformAes192CbcId -#define xmlSecTransformAes256CbcId xmlSecNssTransformAes256CbcId -#define xmlSecTransformKWAes128Id xmlSecNssTransformKWAes128Id -#define xmlSecTransformKWAes192Id xmlSecNssTransformKWAes192Id -#define xmlSecTransformKWAes256Id xmlSecNssTransformKWAes256Id -#define xmlSecTransformDes3CbcId xmlSecNssTransformDes3CbcId -#define xmlSecTransformKWDes3Id xmlSecNssTransformKWDes3Id -#define xmlSecTransformDsaSha1Id xmlSecNssTransformDsaSha1Id -#define xmlSecTransformHmacMd5Id xmlSecNssTransformHmacMd5Id -#define xmlSecTransformHmacRipemd160Id xmlSecNssTransformHmacRipemd160Id -#define xmlSecTransformHmacSha1Id xmlSecNssTransformHmacSha1Id -#define xmlSecTransformRipemd160Id xmlSecNssTransformRipemd160Id -#define xmlSecTransformRsaSha1Id xmlSecNssTransformRsaSha1Id -#define xmlSecTransformRsaPkcs1Id xmlSecNssTransformRsaPkcs1Id -#define xmlSecTransformRsaOaepId xmlSecNssTransformRsaOaepId -#define xmlSecTransformSha1Id xmlSecNssTransformSha1Id + * + ********************************************************************/ +#define xmlSecTransformAes128CbcId xmlSecNssTransformAes128CbcId +#define xmlSecTransformAes192CbcId xmlSecNssTransformAes192CbcId +#define xmlSecTransformAes256CbcId xmlSecNssTransformAes256CbcId +#define xmlSecTransformKWAes128Id xmlSecNssTransformKWAes128Id +#define xmlSecTransformKWAes192Id xmlSecNssTransformKWAes192Id +#define xmlSecTransformKWAes256Id xmlSecNssTransformKWAes256Id +#define xmlSecTransformDes3CbcId xmlSecNssTransformDes3CbcId +#define xmlSecTransformKWDes3Id xmlSecNssTransformKWDes3Id +#define xmlSecTransformDsaSha1Id xmlSecNssTransformDsaSha1Id +#define xmlSecTransformHmacMd5Id xmlSecNssTransformHmacMd5Id +#define xmlSecTransformHmacRipemd160Id xmlSecNssTransformHmacRipemd160Id +#define xmlSecTransformHmacSha1Id xmlSecNssTransformHmacSha1Id +#define xmlSecTransformRipemd160Id xmlSecNssTransformRipemd160Id +#define xmlSecTransformRsaSha1Id xmlSecNssTransformRsaSha1Id +#define xmlSecTransformRsaPkcs1Id xmlSecNssTransformRsaPkcs1Id +#define xmlSecTransformRsaOaepId xmlSecNssTransformRsaOaepId +#define xmlSecTransformSha1Id xmlSecNssTransformSha1Id -/** +/******************************************************************** + * * High level routines form xmlsec command line utility - */ -#define xmlSecCryptoAppInit xmlSecNssAppInit -#define xmlSecCryptoAppShutdown xmlSecNssAppShutdown -#define xmlSecCryptoAppDefaultKeysMngrInit xmlSecNssAppDefaultKeysMngrInit -#define xmlSecCryptoAppDefaultKeysMngrAdoptKey xmlSecNssAppDefaultKeysMngrAdoptKey -#define xmlSecCryptoAppDefaultKeysMngrLoad xmlSecNssAppDefaultKeysMngrLoad -#define xmlSecCryptoAppDefaultKeysMngrSave xmlSecNssAppDefaultKeysMngrSave -#define xmlSecCryptoAppKeysMngrCertLoad xmlSecNssAppKeysMngrCertLoad -#define xmlSecCryptoAppKeysMngrCertLoadMemory xmlSecNssAppKeysMngrCertLoadMemory -#define xmlSecCryptoAppKeyLoad xmlSecNssAppKeyLoad -#define xmlSecCryptoAppPkcs12Load xmlSecNssAppPkcs12Load -#define xmlSecCryptoAppKeyCertLoad xmlSecNssAppKeyCertLoad -#define xmlSecCryptoAppKeyLoadMemory xmlSecNssAppKeyLoadMemory -#define xmlSecCryptoAppPkcs12LoadMemory xmlSecNssAppPkcs12LoadMemory -#define xmlSecCryptoAppKeyCertLoadMemory xmlSecNssAppKeyCertLoadMemory -#define xmlSecCryptoAppGetDefaultPwdCallback xmlSecNssAppGetDefaultPwdCallback + * + ********************************************************************/ +#define xmlSecCryptoAppInit xmlSecNssAppInit +#define xmlSecCryptoAppShutdown xmlSecNssAppShutdown +#define xmlSecCryptoAppDefaultKeysMngrInit xmlSecNssAppDefaultKeysMngrInit +#define xmlSecCryptoAppDefaultKeysMngrAdoptKey xmlSecNssAppDefaultKeysMngrAdoptKey +#define xmlSecCryptoAppDefaultKeysMngrLoad xmlSecNssAppDefaultKeysMngrLoad +#define xmlSecCryptoAppDefaultKeysMngrSave xmlSecNssAppDefaultKeysMngrSave +#define xmlSecCryptoAppKeysMngrCertLoad xmlSecNssAppKeysMngrCertLoad +#define xmlSecCryptoAppKeysMngrCertLoadMemory xmlSecNssAppKeysMngrCertLoadMemory +#define xmlSecCryptoAppKeyLoad xmlSecNssAppKeyLoad +#define xmlSecCryptoAppPkcs12Load xmlSecNssAppPkcs12Load +#define xmlSecCryptoAppKeyCertLoad xmlSecNssAppKeyCertLoad +#define xmlSecCryptoAppKeyLoadMemory xmlSecNssAppKeyLoadMemory +#define xmlSecCryptoAppPkcs12LoadMemory xmlSecNssAppPkcs12LoadMemory +#define xmlSecCryptoAppKeyCertLoadMemory xmlSecNssAppKeyCertLoadMemory +#define xmlSecCryptoAppGetDefaultPwdCallback xmlSecNssAppGetDefaultPwdCallback #endif /* XMLSEC_CRYPTO_NSS */ @@ -96,4 +103,4 @@ extern "C" { #endif /* __XMLSEC_NSS_CRYPTO_H__ */ -#define __XMLSEC_NSS_CRYPTO_H__ +#define __XMLSEC_NSS_CRYPTO_H__ diff --git a/include/xmlsec/nss/x509.h b/include/xmlsec/nss/x509.h index 1e3ba5e7..fe5ceb4a 100644 --- a/include/xmlsec/nss/x509.h +++ b/include/xmlsec/nss/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 America Online, Inc. All rights reserved. */ #ifndef __XMLSEC_NSS_X509_H__ -#define __XMLSEC_NSS_X509_H__ +#define __XMLSEC_NSS_X509_H__ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #ifndef XMLSEC_NO_X509 @@ -25,60 +25,60 @@ extern "C" { /** * xmlSecNssKeyDataX509Id: - * + * * The NSS X509 data klass. */ #define xmlSecNssKeyDataX509Id \ - xmlSecNssKeyDataX509GetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataX509GetKlass(void); + xmlSecNssKeyDataX509GetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataX509GetKlass(void); -XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssKeyDataX509GetKeyCert(xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataX509AdoptKeyCert(xmlSecKeyDataPtr data, - CERTCertificate* cert); +XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssKeyDataX509GetKeyCert(xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataX509AdoptKeyCert(xmlSecKeyDataPtr data, + CERTCertificate* cert); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataX509AdoptCert(xmlSecKeyDataPtr data, - CERTCertificate* cert); -XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssKeyDataX509GetCert (xmlSecKeyDataPtr data, - xmlSecSize pos); -XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecNssKeyDataX509GetCertsSize(xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataX509AdoptCert(xmlSecKeyDataPtr data, + CERTCertificate* cert); +XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssKeyDataX509GetCert (xmlSecKeyDataPtr data, + xmlSecSize pos); +XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecNssKeyDataX509GetCertsSize(xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataX509AdoptCrl(xmlSecKeyDataPtr data, - CERTSignedCrl* crl); -XMLSEC_CRYPTO_EXPORT CERTSignedCrl* xmlSecNssKeyDataX509GetCrl (xmlSecKeyDataPtr data, - xmlSecSize pos); -XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecNssKeyDataX509GetCrlsSize(xmlSecKeyDataPtr data); -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssX509CertGetKey (CERTCertificate* cert); +XMLSEC_CRYPTO_EXPORT int xmlSecNssKeyDataX509AdoptCrl(xmlSecKeyDataPtr data, + CERTSignedCrl* crl); +XMLSEC_CRYPTO_EXPORT CERTSignedCrl* xmlSecNssKeyDataX509GetCrl (xmlSecKeyDataPtr data, + xmlSecSize pos); +XMLSEC_CRYPTO_EXPORT xmlSecSize xmlSecNssKeyDataX509GetCrlsSize(xmlSecKeyDataPtr data); +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssX509CertGetKey (CERTCertificate* cert); /** * xmlSecNssKeyDataRawX509CertId: - * + * * The NSS raw X509 certificate klass. */ #define xmlSecNssKeyDataRawX509CertId \ - xmlSecNssKeyDataRawX509CertGetKlass() -XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataRawX509CertGetKlass(void); + xmlSecNssKeyDataRawX509CertGetKlass() +XMLSEC_CRYPTO_EXPORT xmlSecKeyDataId xmlSecNssKeyDataRawX509CertGetKlass(void); /** * xmlSecNssX509StoreId: - * + * * The NSS X509 store klass. */ #define xmlSecNssX509StoreId \ - xmlSecNssX509StoreGetKlass() + xmlSecNssX509StoreGetKlass() XMLSEC_CRYPTO_EXPORT xmlSecKeyDataStoreId xmlSecNssX509StoreGetKlass(void); -XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssX509StoreFindCert (xmlSecKeyDataStorePtr store, - xmlChar *subjectName, - xmlChar *issuerName, - xmlChar *issuerSerial, - xmlChar *ski, - xmlSecKeyInfoCtx* keyInfoCtx); - -XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssX509StoreVerify (xmlSecKeyDataStorePtr store, - CERTCertList* certs, - xmlSecKeyInfoCtx* keyInfoCtx); -XMLSEC_CRYPTO_EXPORT int xmlSecNssX509StoreAdoptCert (xmlSecKeyDataStorePtr store, - CERTCertificate* cert, +XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssX509StoreFindCert (xmlSecKeyDataStorePtr store, + xmlChar *subjectName, + xmlChar *issuerName, + xmlChar *issuerSerial, + xmlChar *ski, + xmlSecKeyInfoCtx* keyInfoCtx); + +XMLSEC_CRYPTO_EXPORT CERTCertificate* xmlSecNssX509StoreVerify (xmlSecKeyDataStorePtr store, + CERTCertList* certs, + xmlSecKeyInfoCtx* keyInfoCtx); +XMLSEC_CRYPTO_EXPORT int xmlSecNssX509StoreAdoptCert (xmlSecKeyDataStorePtr store, + CERTCertificate* cert, xmlSecKeyDataType type); |