williamr@2
|
1 |
/* pkcs12.h */
|
williamr@2
|
2 |
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
williamr@2
|
3 |
* project 1999.
|
williamr@2
|
4 |
*/
|
williamr@2
|
5 |
/* ====================================================================
|
williamr@2
|
6 |
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
williamr@2
|
7 |
*
|
williamr@2
|
8 |
* Redistribution and use in source and binary forms, with or without
|
williamr@2
|
9 |
* modification, are permitted provided that the following conditions
|
williamr@2
|
10 |
* are met:
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* 1. Redistributions of source code must retain the above copyright
|
williamr@2
|
13 |
* notice, this list of conditions and the following disclaimer.
|
williamr@2
|
14 |
*
|
williamr@2
|
15 |
* 2. Redistributions in binary form must reproduce the above copyright
|
williamr@2
|
16 |
* notice, this list of conditions and the following disclaimer in
|
williamr@2
|
17 |
* the documentation and/or other materials provided with the
|
williamr@2
|
18 |
* distribution.
|
williamr@2
|
19 |
*
|
williamr@2
|
20 |
* 3. All advertising materials mentioning features or use of this
|
williamr@2
|
21 |
* software must display the following acknowledgment:
|
williamr@2
|
22 |
* "This product includes software developed by the OpenSSL Project
|
williamr@2
|
23 |
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
williamr@2
|
24 |
*
|
williamr@2
|
25 |
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
williamr@2
|
26 |
* endorse or promote products derived from this software without
|
williamr@2
|
27 |
* prior written permission. For written permission, please contact
|
williamr@2
|
28 |
* licensing@OpenSSL.org.
|
williamr@2
|
29 |
*
|
williamr@2
|
30 |
* 5. Products derived from this software may not be called "OpenSSL"
|
williamr@2
|
31 |
* nor may "OpenSSL" appear in their names without prior written
|
williamr@2
|
32 |
* permission of the OpenSSL Project.
|
williamr@2
|
33 |
*
|
williamr@2
|
34 |
* 6. Redistributions of any form whatsoever must retain the following
|
williamr@2
|
35 |
* acknowledgment:
|
williamr@2
|
36 |
* "This product includes software developed by the OpenSSL Project
|
williamr@2
|
37 |
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
williamr@2
|
38 |
*
|
williamr@2
|
39 |
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
williamr@2
|
40 |
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
williamr@2
|
41 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
williamr@2
|
42 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
williamr@2
|
43 |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
williamr@2
|
44 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
williamr@2
|
45 |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
williamr@2
|
46 |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
williamr@2
|
47 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
williamr@2
|
48 |
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
williamr@2
|
49 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
williamr@2
|
50 |
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
williamr@2
|
51 |
* ====================================================================
|
williamr@2
|
52 |
*
|
williamr@2
|
53 |
* This product includes cryptographic software written by Eric Young
|
williamr@2
|
54 |
* (eay@cryptsoft.com). This product includes software written by Tim
|
williamr@2
|
55 |
* Hudson (tjh@cryptsoft.com).
|
williamr@2
|
56 |
*
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
/*
|
williamr@2
|
59 |
© Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
|
williamr@2
|
62 |
#ifndef HEADER_PKCS12_H
|
williamr@2
|
63 |
#define HEADER_PKCS12_H
|
williamr@2
|
64 |
|
williamr@2
|
65 |
#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
|
williamr@2
|
66 |
#define SYMBIAN
|
williamr@2
|
67 |
#endif
|
williamr@2
|
68 |
|
williamr@2
|
69 |
#ifdef SYMBIAN
|
williamr@2
|
70 |
#include <e32def.h>
|
williamr@2
|
71 |
#endif
|
williamr@2
|
72 |
#include <openssl/bio.h>
|
williamr@2
|
73 |
#include <openssl/x509.h>
|
williamr@2
|
74 |
|
williamr@2
|
75 |
#ifdef __cplusplus
|
williamr@2
|
76 |
extern "C" {
|
williamr@2
|
77 |
#endif
|
williamr@2
|
78 |
|
williamr@2
|
79 |
#define PKCS12_KEY_ID 1
|
williamr@2
|
80 |
#define PKCS12_IV_ID 2
|
williamr@2
|
81 |
#define PKCS12_MAC_ID 3
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/* Default iteration count */
|
williamr@2
|
84 |
#ifndef PKCS12_DEFAULT_ITER
|
williamr@2
|
85 |
#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
|
williamr@2
|
86 |
#endif
|
williamr@2
|
87 |
|
williamr@2
|
88 |
#define PKCS12_MAC_KEY_LENGTH 20
|
williamr@2
|
89 |
|
williamr@2
|
90 |
#define PKCS12_SALT_LEN 8
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/* Uncomment out next line for unicode password and names, otherwise ASCII */
|
williamr@2
|
93 |
|
williamr@2
|
94 |
/*#define PBE_UNICODE*/
|
williamr@2
|
95 |
|
williamr@2
|
96 |
#ifdef PBE_UNICODE
|
williamr@2
|
97 |
#define PKCS12_key_gen PKCS12_key_gen_uni
|
williamr@2
|
98 |
#define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni
|
williamr@2
|
99 |
#else
|
williamr@2
|
100 |
#define PKCS12_key_gen PKCS12_key_gen_asc
|
williamr@2
|
101 |
#define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc
|
williamr@2
|
102 |
#endif
|
williamr@2
|
103 |
|
williamr@2
|
104 |
/* MS key usage constants */
|
williamr@2
|
105 |
|
williamr@2
|
106 |
#define KEY_EX 0x10
|
williamr@2
|
107 |
#define KEY_SIG 0x80
|
williamr@2
|
108 |
|
williamr@2
|
109 |
typedef struct {
|
williamr@2
|
110 |
X509_SIG *dinfo;
|
williamr@2
|
111 |
ASN1_OCTET_STRING *salt;
|
williamr@2
|
112 |
ASN1_INTEGER *iter; /* defaults to 1 */
|
williamr@2
|
113 |
} PKCS12_MAC_DATA;
|
williamr@2
|
114 |
|
williamr@2
|
115 |
typedef struct {
|
williamr@2
|
116 |
ASN1_INTEGER *version;
|
williamr@2
|
117 |
PKCS12_MAC_DATA *mac;
|
williamr@2
|
118 |
PKCS7 *authsafes;
|
williamr@2
|
119 |
} PKCS12;
|
williamr@2
|
120 |
|
williamr@2
|
121 |
PREDECLARE_STACK_OF(PKCS12_SAFEBAG)
|
williamr@2
|
122 |
|
williamr@2
|
123 |
typedef struct {
|
williamr@2
|
124 |
ASN1_OBJECT *type;
|
williamr@2
|
125 |
union {
|
williamr@2
|
126 |
struct pkcs12_bag_st *bag; /* secret, crl and certbag */
|
williamr@2
|
127 |
struct pkcs8_priv_key_info_st *keybag; /* keybag */
|
williamr@2
|
128 |
X509_SIG *shkeybag; /* shrouded key bag */
|
williamr@2
|
129 |
STACK_OF(PKCS12_SAFEBAG) *safes;
|
williamr@2
|
130 |
ASN1_TYPE *other;
|
williamr@2
|
131 |
}value;
|
williamr@2
|
132 |
STACK_OF(X509_ATTRIBUTE) *attrib;
|
williamr@2
|
133 |
} PKCS12_SAFEBAG;
|
williamr@2
|
134 |
|
williamr@2
|
135 |
DECLARE_STACK_OF(PKCS12_SAFEBAG)
|
williamr@2
|
136 |
DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG)
|
williamr@2
|
137 |
DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG)
|
williamr@2
|
138 |
|
williamr@2
|
139 |
typedef struct pkcs12_bag_st {
|
williamr@2
|
140 |
ASN1_OBJECT *type;
|
williamr@2
|
141 |
union {
|
williamr@2
|
142 |
ASN1_OCTET_STRING *x509cert;
|
williamr@2
|
143 |
ASN1_OCTET_STRING *x509crl;
|
williamr@2
|
144 |
ASN1_OCTET_STRING *octet;
|
williamr@2
|
145 |
ASN1_IA5STRING *sdsicert;
|
williamr@2
|
146 |
ASN1_TYPE *other; /* Secret or other bag */
|
williamr@2
|
147 |
}value;
|
williamr@2
|
148 |
} PKCS12_BAGS;
|
williamr@2
|
149 |
|
williamr@2
|
150 |
#define PKCS12_ERROR 0
|
williamr@2
|
151 |
#define PKCS12_OK 1
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/* Compatibility macros */
|
williamr@2
|
154 |
|
williamr@2
|
155 |
#define M_PKCS12_x5092certbag PKCS12_x5092certbag
|
williamr@2
|
156 |
#define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag
|
williamr@2
|
157 |
|
williamr@2
|
158 |
#define M_PKCS12_certbag2x509 PKCS12_certbag2x509
|
williamr@2
|
159 |
#define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl
|
williamr@2
|
160 |
|
williamr@2
|
161 |
#define M_PKCS12_unpack_p7data PKCS12_unpack_p7data
|
williamr@2
|
162 |
#define M_PKCS12_pack_authsafes PKCS12_pack_authsafes
|
williamr@2
|
163 |
#define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes
|
williamr@2
|
164 |
#define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata
|
williamr@2
|
165 |
|
williamr@2
|
166 |
#define M_PKCS12_decrypt_skey PKCS12_decrypt_skey
|
williamr@2
|
167 |
#define M_PKCS8_decrypt PKCS8_decrypt
|
williamr@2
|
168 |
|
williamr@2
|
169 |
#define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type)
|
williamr@2
|
170 |
#define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type)
|
williamr@2
|
171 |
#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type
|
williamr@2
|
172 |
|
williamr@2
|
173 |
#define PKCS12_get_attr(bag, attr_nid) \
|
williamr@2
|
174 |
PKCS12_get_attr_gen(bag->attrib, attr_nid)
|
williamr@2
|
175 |
|
williamr@2
|
176 |
#define PKCS8_get_attr(p8, attr_nid) \
|
williamr@2
|
177 |
PKCS12_get_attr_gen(p8->attributes, attr_nid)
|
williamr@2
|
178 |
|
williamr@2
|
179 |
#define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0)
|
williamr@2
|
180 |
|
williamr@2
|
181 |
|
williamr@2
|
182 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509);
|
williamr@2
|
183 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl);
|
williamr@2
|
184 |
IMPORT_C X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
|
williamr@2
|
185 |
IMPORT_C X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag);
|
williamr@2
|
186 |
|
williamr@2
|
187 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1,
|
williamr@2
|
188 |
int nid2);
|
williamr@2
|
189 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8);
|
williamr@2
|
190 |
IMPORT_C PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen);
|
williamr@2
|
191 |
IMPORT_C PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass,
|
williamr@2
|
192 |
int passlen);
|
williamr@2
|
193 |
IMPORT_C X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
|
williamr@2
|
194 |
const char *pass, int passlen,
|
williamr@2
|
195 |
unsigned char *salt, int saltlen, int iter,
|
williamr@2
|
196 |
PKCS8_PRIV_KEY_INFO *p8);
|
williamr@2
|
197 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
|
williamr@2
|
198 |
int passlen, unsigned char *salt,
|
williamr@2
|
199 |
int saltlen, int iter,
|
williamr@2
|
200 |
PKCS8_PRIV_KEY_INFO *p8);
|
williamr@2
|
201 |
IMPORT_C PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
|
williamr@2
|
202 |
IMPORT_C STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
|
williamr@2
|
203 |
IMPORT_C PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
|
williamr@2
|
204 |
unsigned char *salt, int saltlen, int iter,
|
williamr@2
|
205 |
STACK_OF(PKCS12_SAFEBAG) *bags);
|
williamr@2
|
206 |
IMPORT_C STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen);
|
williamr@2
|
207 |
|
williamr@2
|
208 |
IMPORT_C int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
|
williamr@2
|
209 |
IMPORT_C STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12);
|
williamr@2
|
210 |
|
williamr@2
|
211 |
IMPORT_C int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen);
|
williamr@2
|
212 |
IMPORT_C int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
|
williamr@2
|
213 |
int namelen);
|
williamr@2
|
214 |
IMPORT_C int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
|
williamr@2
|
215 |
int namelen);
|
williamr@2
|
216 |
IMPORT_C int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name,
|
williamr@2
|
217 |
int namelen);
|
williamr@2
|
218 |
IMPORT_C int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
|
williamr@2
|
219 |
IMPORT_C ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);
|
williamr@2
|
220 |
IMPORT_C char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
|
williamr@2
|
221 |
IMPORT_C unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
|
williamr@2
|
222 |
int passlen, unsigned char *in, int inlen,
|
williamr@2
|
223 |
unsigned char **data, int *datalen, int en_de);
|
williamr@2
|
224 |
IMPORT_C void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
|
williamr@2
|
225 |
const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf);
|
williamr@2
|
226 |
IMPORT_C ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it,
|
williamr@2
|
227 |
const char *pass, int passlen,
|
williamr@2
|
228 |
void *obj, int zbuf);
|
williamr@2
|
229 |
IMPORT_C PKCS12 *PKCS12_init(int mode);
|
williamr@2
|
230 |
IMPORT_C int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
|
williamr@2
|
231 |
int saltlen, int id, int iter, int n,
|
williamr@2
|
232 |
unsigned char *out, const EVP_MD *md_type);
|
williamr@2
|
233 |
IMPORT_C int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type);
|
williamr@2
|
234 |
IMPORT_C int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
williamr@2
|
235 |
ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type,
|
williamr@2
|
236 |
int en_de);
|
williamr@2
|
237 |
IMPORT_C int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
|
williamr@2
|
238 |
unsigned char *mac, unsigned int *maclen);
|
williamr@2
|
239 |
IMPORT_C int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
|
williamr@2
|
240 |
IMPORT_C int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
|
williamr@2
|
241 |
unsigned char *salt, int saltlen, int iter,
|
williamr@2
|
242 |
const EVP_MD *md_type);
|
williamr@2
|
243 |
IMPORT_C int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
|
williamr@2
|
244 |
int saltlen, const EVP_MD *md_type);
|
williamr@2
|
245 |
IMPORT_C unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen);
|
williamr@2
|
246 |
IMPORT_C char *uni2asc(unsigned char *uni, int unilen);
|
williamr@2
|
247 |
|
williamr@2
|
248 |
DECLARE_ASN1_FUNCTIONS(PKCS12)
|
williamr@2
|
249 |
DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
|
williamr@2
|
250 |
DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
|
williamr@2
|
251 |
DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
|
williamr@2
|
252 |
|
williamr@2
|
253 |
DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
|
williamr@2
|
254 |
DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
|
williamr@2
|
255 |
|
williamr@2
|
256 |
IMPORT_C void PKCS12_PBE_add(void);
|
williamr@2
|
257 |
IMPORT_C int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
|
williamr@2
|
258 |
STACK_OF(X509) **ca);
|
williamr@2
|
259 |
IMPORT_C PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
|
williamr@2
|
260 |
STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
|
williamr@2
|
261 |
int mac_iter, int keytype);
|
williamr@2
|
262 |
|
williamr@2
|
263 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
|
williamr@2
|
264 |
IMPORT_C PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key,
|
williamr@2
|
265 |
int key_usage, int iter,
|
williamr@2
|
266 |
int key_nid, char *pass);
|
williamr@2
|
267 |
IMPORT_C int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
williamr@2
|
268 |
int safe_nid, int iter, char *pass);
|
williamr@2
|
269 |
IMPORT_C PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
|
williamr@2
|
270 |
|
williamr@2
|
271 |
IMPORT_C int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
|
williamr@2
|
272 |
IMPORT_C int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
|
williamr@2
|
273 |
IMPORT_C PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
|
williamr@2
|
274 |
IMPORT_C PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
|
williamr@2
|
275 |
IMPORT_C int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
|
williamr@2
|
276 |
|
williamr@2
|
277 |
/* BEGIN ERROR CODES */
|
williamr@2
|
278 |
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
williamr@2
|
279 |
* made after this point may be overwritten when the script is next run.
|
williamr@2
|
280 |
*/
|
williamr@2
|
281 |
IMPORT_C void ERR_load_PKCS12_strings(void);
|
williamr@2
|
282 |
|
williamr@2
|
283 |
/* Error codes for the PKCS12 functions. */
|
williamr@2
|
284 |
|
williamr@2
|
285 |
/* Function codes. */
|
williamr@2
|
286 |
#define PKCS12_F_PARSE_BAG 129
|
williamr@2
|
287 |
#define PKCS12_F_PARSE_BAGS 103
|
williamr@2
|
288 |
#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100
|
williamr@2
|
289 |
#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127
|
williamr@2
|
290 |
#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102
|
williamr@2
|
291 |
#define PKCS12_F_PKCS12_ADD_LOCALKEYID 104
|
williamr@2
|
292 |
#define PKCS12_F_PKCS12_CREATE 105
|
williamr@2
|
293 |
#define PKCS12_F_PKCS12_GEN_MAC 107
|
williamr@2
|
294 |
#define PKCS12_F_PKCS12_INIT 109
|
williamr@2
|
295 |
#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
|
williamr@2
|
296 |
#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
|
williamr@2
|
297 |
#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
|
williamr@2
|
298 |
#define PKCS12_F_PKCS12_KEY_GEN_ASC 110
|
williamr@2
|
299 |
#define PKCS12_F_PKCS12_KEY_GEN_UNI 111
|
williamr@2
|
300 |
#define PKCS12_F_PKCS12_MAKE_KEYBAG 112
|
williamr@2
|
301 |
#define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113
|
williamr@2
|
302 |
#define PKCS12_F_PKCS12_NEWPASS 128
|
williamr@2
|
303 |
#define PKCS12_F_PKCS12_PACK_P7DATA 114
|
williamr@2
|
304 |
#define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
|
williamr@2
|
305 |
#define PKCS12_F_PKCS12_PARSE 118
|
williamr@2
|
306 |
#define PKCS12_F_PKCS12_PBE_CRYPT 119
|
williamr@2
|
307 |
#define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
|
williamr@2
|
308 |
#define PKCS12_F_PKCS12_SETUP_MAC 122
|
williamr@2
|
309 |
#define PKCS12_F_PKCS12_SET_MAC 123
|
williamr@2
|
310 |
#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
|
williamr@2
|
311 |
#define PKCS12_F_PKCS12_UNPACK_P7DATA 131
|
williamr@2
|
312 |
#define PKCS12_F_PKCS12_VERIFY_MAC 126
|
williamr@2
|
313 |
#define PKCS12_F_PKCS8_ADD_KEYUSAGE 124
|
williamr@2
|
314 |
#define PKCS12_F_PKCS8_ENCRYPT 125
|
williamr@2
|
315 |
|
williamr@2
|
316 |
/* Reason codes. */
|
williamr@2
|
317 |
#define PKCS12_R_CANT_PACK_STRUCTURE 100
|
williamr@2
|
318 |
#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
|
williamr@2
|
319 |
#define PKCS12_R_DECODE_ERROR 101
|
williamr@2
|
320 |
#define PKCS12_R_ENCODE_ERROR 102
|
williamr@2
|
321 |
#define PKCS12_R_ENCRYPT_ERROR 103
|
williamr@2
|
322 |
#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
|
williamr@2
|
323 |
#define PKCS12_R_INVALID_NULL_ARGUMENT 104
|
williamr@2
|
324 |
#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
|
williamr@2
|
325 |
#define PKCS12_R_IV_GEN_ERROR 106
|
williamr@2
|
326 |
#define PKCS12_R_KEY_GEN_ERROR 107
|
williamr@2
|
327 |
#define PKCS12_R_MAC_ABSENT 108
|
williamr@2
|
328 |
#define PKCS12_R_MAC_GENERATION_ERROR 109
|
williamr@2
|
329 |
#define PKCS12_R_MAC_SETUP_ERROR 110
|
williamr@2
|
330 |
#define PKCS12_R_MAC_STRING_SET_ERROR 111
|
williamr@2
|
331 |
#define PKCS12_R_MAC_VERIFY_ERROR 112
|
williamr@2
|
332 |
#define PKCS12_R_MAC_VERIFY_FAILURE 113
|
williamr@2
|
333 |
#define PKCS12_R_PARSE_ERROR 114
|
williamr@2
|
334 |
#define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
|
williamr@2
|
335 |
#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
|
williamr@2
|
336 |
#define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
|
williamr@2
|
337 |
#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
|
williamr@2
|
338 |
#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
|
williamr@2
|
339 |
|
williamr@2
|
340 |
#ifdef __cplusplus
|
williamr@2
|
341 |
}
|
williamr@2
|
342 |
#endif
|
williamr@2
|
343 |
#endif
|