Git init
[external/xmlsec1.git] / include / xmlsec / nss / app.h
1 /** 
2  * XMLSec library
3  *
4  * This is free software; see Copyright file in the source
5  * distribution for preciese wording.
6  * 
7  * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
8  * Copyright (c) 2003 America Online, Inc.  All rights reserved.
9  */
10 #ifndef __XMLSEC_NSS_APP_H__
11 #define __XMLSEC_NSS_APP_H__    
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */ 
16
17 #include <nspr.h>
18 #include <nss.h>
19
20 #include <xmlsec/xmlsec.h>
21 #include <xmlsec/keys.h>
22 #include <xmlsec/keysmngr.h>
23 #include <xmlsec/transforms.h>
24
25 /**
26  * Init/shutdown
27  */
28 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppInit                (const char* config);
29 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppShutdown            (void);
30
31 /** 
32  * Keys Manager
33  */
34 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr);
35 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr,
36                                                                             xmlSecKeyPtr key);
37 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr,
38                                                                          const char* uri);
39 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr,
40                                                                          const char* filename,
41                                                                          xmlSecKeyDataType type);
42 #ifndef XMLSEC_NO_X509
43 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppKeysMngrCertLoad    (xmlSecKeysMngrPtr mngr, 
44                                                                          const char *filename, 
45                                                                          xmlSecKeyDataFormat format, 
46                                                                          xmlSecKeyDataType type);
47 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppKeysMngrCertLoadMemory(xmlSecKeysMngrPtr mngr, 
48                                                                          const xmlSecByte *data, 
49                                                                          xmlSecSize dataSize,
50                                                                          xmlSecKeyDataFormat format, 
51                                                                          xmlSecKeyDataType type);
52 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppKeysMngrCertLoadSECItem(xmlSecKeysMngrPtr mngr, 
53                                                                          SECItem* secItem,
54                                                                          xmlSecKeyDataFormat format, 
55                                                                          xmlSecKeyDataType type);
56 #endif /* XMLSEC_NO_X509 */
57
58
59 /** 
60  * Keys
61  */
62 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppKeyLoad             (const char *filename, 
63                                                                          xmlSecKeyDataFormat format,
64                                                                          const char *pwd,
65                                                                          void *pwdCallback,
66                                                                          void* pwdCallbackCtx);
67 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppKeyLoadMemory       (const xmlSecByte *data, 
68                                                                          xmlSecSize dataSize,
69                                                                          xmlSecKeyDataFormat format,
70                                                                          const char *pwd,
71                                                                          void *pwdCallback,
72                                                                          void* pwdCallbackCtx);
73 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppKeyLoadSECItem      (SECItem* secItem,
74                                                                          xmlSecKeyDataFormat format,
75                                                                          const char *pwd,
76                                                                          void *pwdCallback,
77                                                                          void* pwdCallbackCtx);
78 #ifndef XMLSEC_NO_X509
79 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppPkcs12Load          (const char *filename, 
80                                                                          const char *pwd,
81                                                                          void* pwdCallback, 
82                                                                          void* pwdCallbackCtx);
83 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppPkcs12LoadMemory    (const xmlSecByte *data, 
84                                                                          xmlSecSize dataSize, 
85                                                                          const char *pwd,
86                                                                          void* pwdCallback, 
87                                                                          void* pwdCallbackCtx);
88 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppPkcs12LoadSECItem   (SECItem* secItem,
89                                                                          const char *pwd,
90                                                                          void* pwdCallback, 
91                                                                          void* pwdCallbackCtx);
92 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppKeyCertLoad         (xmlSecKeyPtr key,
93                                                                          const char* filename,
94                                                                          xmlSecKeyDataFormat format);
95 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppKeyCertLoadMemory   (xmlSecKeyPtr key,
96                                                                          const xmlSecByte *data, 
97                                                                          xmlSecSize dataSize,                                                                    
98                                                                          xmlSecKeyDataFormat format);
99 XMLSEC_CRYPTO_EXPORT int                xmlSecNssAppKeyCertLoadSECItem  (xmlSecKeyPtr key,
100                                                                          SECItem* secItem,
101                                                                          xmlSecKeyDataFormat format);
102 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecNssAppKeyFromCertLoadSECItem(SECItem* secItem,
103                                                                          xmlSecKeyDataFormat format);
104 #endif /* XMLSEC_NO_X509 */
105 XMLSEC_CRYPTO_EXPORT void*              xmlSecNssAppGetDefaultPwdCallback(void);
106
107 #ifdef __cplusplus
108 }
109 #endif /* __cplusplus */
110
111 #endif /* __XMLSEC_NSS_APP_H__ */
112