Git init
[external/xmlsec1.git] / include / xmlsec / openssl / 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  */
9 #ifndef __XMLSEC_OPENSSL_APP_H__
10 #define __XMLSEC_OPENSSL_APP_H__    
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */ 
15
16 #include <openssl/pem.h>
17 #include <openssl/bio.h>
18
19 #include <xmlsec/xmlsec.h>
20 #include <xmlsec/keys.h>
21 #include <xmlsec/keysmngr.h>
22 #include <xmlsec/transforms.h>
23
24 /**
25  * Init/shutdown
26  */
27 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppInit            (const char* config);
28 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppShutdown        (void);
29
30 /** 
31  * Keys Manager
32  */
33 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppDefaultKeysMngrInit(xmlSecKeysMngrPtr mngr);
34 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr,
35                                                                          xmlSecKeyPtr key);
36 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppDefaultKeysMngrLoad(xmlSecKeysMngrPtr mngr,
37                                                                          const char* uri);
38 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppDefaultKeysMngrSave(xmlSecKeysMngrPtr mngr,
39                                                                          const char* filename,
40                                                                          xmlSecKeyDataType type);
41 #ifndef XMLSEC_NO_X509
42 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeysMngrCertLoad(xmlSecKeysMngrPtr mngr, 
43                                                                          const char *filename, 
44                                                                          xmlSecKeyDataFormat format,
45                                                                          xmlSecKeyDataType type);
46 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeysMngrCertLoadMemory(xmlSecKeysMngrPtr mngr, 
47                                                                          const xmlSecByte* data,
48                                                                          xmlSecSize dataSize, 
49                                                                          xmlSecKeyDataFormat format,
50                                                                          xmlSecKeyDataType type);
51 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeysMngrCertLoadBIO(xmlSecKeysMngrPtr mngr, 
52                                                                          BIO* bio,
53                                                                          xmlSecKeyDataFormat format,
54                                                                          xmlSecKeyDataType type);
55
56 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeysMngrAddCertsPath(xmlSecKeysMngrPtr mngr, 
57                                                                          const char *path);
58 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeysMngrAddCertsFile(xmlSecKeysMngrPtr mngr,
59                                                                          const char *file);
60
61 #endif /* XMLSEC_NO_X509 */
62
63
64 /** 
65  * Keys
66  */
67 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppKeyLoad         (const char *filename, 
68                                                                          xmlSecKeyDataFormat format,
69                                                                          const char *pwd,
70                                                                          void* pwdCallback,
71                                                                          void* pwdCallbackCtx);
72 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppKeyLoadMemory   (const xmlSecByte* data,
73                                                                          xmlSecSize dataSize, 
74                                                                          xmlSecKeyDataFormat format,
75                                                                          const char *pwd,
76                                                                          void* pwdCallback,
77                                                                          void* pwdCallbackCtx);
78 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppKeyLoadBIO      (BIO* bio,
79                                                                          xmlSecKeyDataFormat format,
80                                                                          const char *pwd,
81                                                                          void* pwdCallback,
82                                                                          void* pwdCallbackCtx);
83
84 #ifndef XMLSEC_NO_X509
85 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppPkcs12Load      (const char* filename, 
86                                                                          const char* pwd,
87                                                                          void* pwdCallback, 
88                                                                          void* pwdCallbackCtx);
89 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppPkcs12LoadMemory(const xmlSecByte* data,
90                                                                          xmlSecSize dataSize, 
91                                                                          const char* pwd,
92                                                                          void* pwdCallback, 
93                                                                          void* pwdCallbackCtx);
94 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppPkcs12LoadBIO   (BIO* bio, 
95                                                                          const char* pwd,
96                                                                          void* pwdCallback, 
97                                                                          void* pwdCallbackCtx);
98
99 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeyCertLoad     (xmlSecKeyPtr key,
100                                                                          const char* filename,
101                                                                          xmlSecKeyDataFormat format);
102 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeyCertLoadMemory(xmlSecKeyPtr key,
103                                                                          const xmlSecByte* data,
104                                                                          xmlSecSize dataSize, 
105                                                                          xmlSecKeyDataFormat format);
106 XMLSEC_CRYPTO_EXPORT int                xmlSecOpenSSLAppKeyCertLoadBIO  (xmlSecKeyPtr key,
107                                                                          BIO* bio,
108                                                                          xmlSecKeyDataFormat format);
109 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr       xmlSecOpenSSLAppKeyFromCertLoadBIO(BIO* bio, 
110                                                                          xmlSecKeyDataFormat format);
111 #endif /* XMLSEC_NO_X509 */
112
113 XMLSEC_CRYPTO_EXPORT void*              xmlSecOpenSSLAppGetDefaultPwdCallback(void);
114
115
116 #ifdef __cplusplus
117 }
118 #endif /* __cplusplus */
119
120 #endif /* __XMLSEC_OPENSSL_APP_H__ */
121
122