Git init
[external/xmlsec1.git] / include / xmlsec / mscrypto / 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  * Copyrigth (C) 2003 Cordys R&D BV, All rights reserved.
8  */
9 #ifndef __XMLSEC_MSCRYPTO_APP_H__
10 #define __XMLSEC_MSCRYPTO_APP_H__    
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */ 
15
16 #include <xmlsec/xmlsec.h>
17 #include <xmlsec/keys.h>
18 #include <xmlsec/keysmngr.h>
19 #include <xmlsec/transforms.h>
20
21 #include <windows.h>
22 #include <wincrypt.h>
23
24 /**
25  * Init/shutdown
26  */
27 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppInit                           (const char* config);
28 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppShutdown                       (void);
29 XMLSEC_CRYPTO_EXPORT const char*xmlSecMSCryptoAppGetCertStoreName               (void);
30
31 /** 
32  * Keys Manager
33  */
34 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrInit(
35                                     xmlSecKeysMngrPtr mngr);
36 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrAdoptKey(
37                                     xmlSecKeysMngrPtr mngr,
38                                     xmlSecKeyPtr key);
39 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrLoad(
40                                     xmlSecKeysMngrPtr mngr,
41                                                                         const char* uri);
42 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrSave(
43                                     xmlSecKeysMngrPtr mngr,
44                                                                         const char* filename,
45                                                                         xmlSecKeyDataType type);
46 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrPrivateKeyLoad(\r
47                                     xmlSecKeysMngrPtr mngr,\r
48                                     HCRYPTKEY hKey);\r
49 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrPublicKeyLoad(\r
50                                     xmlSecKeysMngrPtr mngr,\r
51                                     HCRYPTKEY hKey);\r
52 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppDefaultKeysMngrSymKeyLoad(\r
53                                     xmlSecKeysMngrPtr mngr,\r
54                                     HCRYPTKEY hKey);
55 #ifndef XMLSEC_NO_X509
56 XMLSEC_CRYPTO_EXPORT int    xmlSecMSCryptoAppDefaultKeysMngrAdoptKeyStore(\r
57                                     xmlSecKeysMngrPtr mngr,\r
58                                     HCERTSTORE keyStore);\r
59 \r
60 XMLSEC_CRYPTO_EXPORT int    xmlSecMSCryptoAppDefaultKeysMngrAdoptTrustedStore(\r
61                                     xmlSecKeysMngrPtr mngr, \r
62                                     HCERTSTORE trustedStore);\r
63 \r
64 XMLSEC_CRYPTO_EXPORT int    xmlSecMSCryptoAppDefaultKeysMngrAdoptUntrustedStore(\r
65                                     xmlSecKeysMngrPtr mngr,\r
66                                     HCERTSTORE untrustedStore);\r
67
68 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppKeysMngrCertLoad(
69                                     xmlSecKeysMngrPtr mngr, 
70                                                                         const char *filename, 
71                                                                         xmlSecKeyDataFormat format, 
72                                                                         xmlSecKeyDataType type);
73 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppKeysMngrCertLoadMemory(
74                                     xmlSecKeysMngrPtr mngr, 
75                                                                         const xmlSecByte* data,
76                                                                         xmlSecSize dataSize, 
77                                                                         xmlSecKeyDataFormat format,
78                                                                         xmlSecKeyDataType type);
79 \r
80 #endif /* XMLSEC_NO_X509 */
81
82
83 /** 
84  * Keys
85  */
86 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppKeyLoad              (const char *filename, 
87                                                                          xmlSecKeyDataFormat format,
88                                                                          const char *pwd,
89                                                                          void *pwdCallback,
90                                                                          void* pwdCallbackCtx);
91 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppKeyLoadMemory        (const xmlSecByte* data, 
92                                                                          xmlSecSize dataSize, 
93                                                                          xmlSecKeyDataFormat format,
94                                                                          const char *pwd,
95                                                                          void* pwdCallback, 
96                                                                          void* pwdCallbackCtx);
97 #ifndef XMLSEC_NO_X509
98 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppPkcs12Load           (const char *filename, 
99                                                                          const char *pwd,
100                                                                          void* pwdCallback, 
101                                                                          void* pwdCallbackCtx);
102 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecMSCryptoAppPkcs12LoadMemory     (const xmlSecByte* data,
103                                                                          xmlSecSize dataSize, 
104                                                                          const char* pwd,
105                                                                          void* pwdCallback, 
106                                                                          void* pwdCallbackCtx);
107 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppKeyCertLoad            (xmlSecKeyPtr key,
108                                                                          const char* filename,
109                                                                          xmlSecKeyDataFormat format);
110 XMLSEC_CRYPTO_EXPORT int        xmlSecMSCryptoAppKeyCertLoadMemory      (xmlSecKeyPtr key,
111                                                                          const xmlSecByte* data,
112                                                                          xmlSecSize dataSize, 
113                                                                          xmlSecKeyDataFormat format);
114 #endif /* XMLSEC_NO_X509 */
115 XMLSEC_CRYPTO_EXPORT void*      xmlSecMSCryptoAppGetDefaultPwdCallback  (void);
116
117 #ifdef __cplusplus
118 }
119 #endif /* __cplusplus */
120
121 #endif /* __XMLSEC_MSCRYPTO_APP_H__ */
122