1 | /*
|
---|
2 | * WARNING: do not edit!
|
---|
3 | * Generated by Makefile from pkcs12.h.in
|
---|
4 | *
|
---|
5 | * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
|
---|
6 | *
|
---|
7 | * Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
8 | * this file except in compliance with the License. You can obtain a copy
|
---|
9 | * in the file LICENSE in the source distribution or at
|
---|
10 | * https://www.openssl.org/source/license.html
|
---|
11 | */
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 | #ifndef OPENSSL_PKCS12_H
|
---|
16 | # define OPENSSL_PKCS12_H
|
---|
17 | # pragma once
|
---|
18 |
|
---|
19 | # include <openssl/macros.h>
|
---|
20 | # ifndef OPENSSL_NO_DEPRECATED_3_0
|
---|
21 | # define HEADER_PKCS12_H
|
---|
22 | # endif
|
---|
23 |
|
---|
24 | # include <openssl/bio.h>
|
---|
25 | # include <openssl/core.h>
|
---|
26 | # include <openssl/x509.h>
|
---|
27 | # include <openssl/pkcs12err.h>
|
---|
28 | # ifndef OPENSSL_NO_STDIO
|
---|
29 | # include <stdio.h>
|
---|
30 | # endif
|
---|
31 |
|
---|
32 | #ifdef __cplusplus
|
---|
33 | extern "C" {
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | # define PKCS12_KEY_ID 1
|
---|
37 | # define PKCS12_IV_ID 2
|
---|
38 | # define PKCS12_MAC_ID 3
|
---|
39 |
|
---|
40 | /* Default iteration count */
|
---|
41 | # ifndef PKCS12_DEFAULT_ITER
|
---|
42 | # define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
|
---|
43 | # endif
|
---|
44 |
|
---|
45 | # define PKCS12_MAC_KEY_LENGTH 20
|
---|
46 |
|
---|
47 | /* The macro is expected to be used only internally. Kept for backwards compatibility. */
|
---|
48 | # define PKCS12_SALT_LEN 8
|
---|
49 |
|
---|
50 | /* It's not clear if these are actually needed... */
|
---|
51 | # define PKCS12_key_gen PKCS12_key_gen_utf8
|
---|
52 | # define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8
|
---|
53 |
|
---|
54 | /* MS key usage constants */
|
---|
55 |
|
---|
56 | # define KEY_EX 0x10
|
---|
57 | # define KEY_SIG 0x80
|
---|
58 |
|
---|
59 | typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
|
---|
60 |
|
---|
61 | typedef struct PKCS12_st PKCS12;
|
---|
62 |
|
---|
63 | typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
|
---|
64 |
|
---|
65 | SKM_DEFINE_STACK_OF_INTERNAL(PKCS12_SAFEBAG, PKCS12_SAFEBAG, PKCS12_SAFEBAG)
|
---|
66 | #define sk_PKCS12_SAFEBAG_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
---|
67 | #define sk_PKCS12_SAFEBAG_value(sk, idx) ((PKCS12_SAFEBAG *)OPENSSL_sk_value(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), (idx)))
|
---|
68 | #define sk_PKCS12_SAFEBAG_new(cmp) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
---|
69 | #define sk_PKCS12_SAFEBAG_new_null() ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_null())
|
---|
70 | #define sk_PKCS12_SAFEBAG_new_reserve(cmp, n) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_reserve(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp), (n)))
|
---|
71 | #define sk_PKCS12_SAFEBAG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (n))
|
---|
72 | #define sk_PKCS12_SAFEBAG_free(sk) OPENSSL_sk_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
---|
73 | #define sk_PKCS12_SAFEBAG_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
---|
74 | #define sk_PKCS12_SAFEBAG_delete(sk, i) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (i)))
|
---|
75 | #define sk_PKCS12_SAFEBAG_delete_ptr(sk, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete_ptr(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)))
|
---|
76 | #define sk_PKCS12_SAFEBAG_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
---|
77 | #define sk_PKCS12_SAFEBAG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
---|
78 | #define sk_PKCS12_SAFEBAG_pop(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_pop(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
---|
79 | #define sk_PKCS12_SAFEBAG_shift(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_shift(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
---|
80 | #define sk_PKCS12_SAFEBAG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk),ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc))
|
---|
81 | #define sk_PKCS12_SAFEBAG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), (idx))
|
---|
82 | #define sk_PKCS12_SAFEBAG_set(sk, idx, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_set(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (idx), ossl_check_PKCS12_SAFEBAG_type(ptr)))
|
---|
83 | #define sk_PKCS12_SAFEBAG_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
---|
84 | #define sk_PKCS12_SAFEBAG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
---|
85 | #define sk_PKCS12_SAFEBAG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), pnum)
|
---|
86 | #define sk_PKCS12_SAFEBAG_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
---|
87 | #define sk_PKCS12_SAFEBAG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
---|
88 | #define sk_PKCS12_SAFEBAG_dup(sk) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_dup(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk)))
|
---|
89 | #define sk_PKCS12_SAFEBAG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_copyfunc_type(copyfunc), ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc)))
|
---|
90 | #define sk_PKCS12_SAFEBAG_set_cmp_func(sk, cmp) ((sk_PKCS12_SAFEBAG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
---|
91 |
|
---|
92 |
|
---|
93 | typedef struct pkcs12_bag_st PKCS12_BAGS;
|
---|
94 |
|
---|
95 | # define PKCS12_ERROR 0
|
---|
96 | # define PKCS12_OK 1
|
---|
97 |
|
---|
98 | /* Compatibility macros */
|
---|
99 |
|
---|
100 | #ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
---|
101 |
|
---|
102 | # define M_PKCS12_bag_type PKCS12_bag_type
|
---|
103 | # define M_PKCS12_cert_bag_type PKCS12_cert_bag_type
|
---|
104 | # define M_PKCS12_crl_bag_type PKCS12_cert_bag_type
|
---|
105 |
|
---|
106 | # define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert
|
---|
107 | # define PKCS12_certbag2scrl PKCS12_SAFEBAG_get1_crl
|
---|
108 | # define PKCS12_bag_type PKCS12_SAFEBAG_get_nid
|
---|
109 | # define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid
|
---|
110 | # define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert
|
---|
111 | # define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl
|
---|
112 | # define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf
|
---|
113 | # define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
|
---|
114 |
|
---|
115 | #endif
|
---|
116 | #ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
---|
117 | OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
|
---|
118 | int attr_nid);
|
---|
119 | #endif
|
---|
120 |
|
---|
121 | ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
|
---|
122 | int PKCS12_mac_present(const PKCS12 *p12);
|
---|
123 | void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
|
---|
124 | const X509_ALGOR **pmacalg,
|
---|
125 | const ASN1_OCTET_STRING **psalt,
|
---|
126 | const ASN1_INTEGER **piter,
|
---|
127 | const PKCS12 *p12);
|
---|
128 |
|
---|
129 | const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
|
---|
130 | int attr_nid);
|
---|
131 | const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag);
|
---|
132 | int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
|
---|
133 | int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
|
---|
134 | const ASN1_TYPE *PKCS12_SAFEBAG_get0_bag_obj(const PKCS12_SAFEBAG *bag);
|
---|
135 | const ASN1_OBJECT *PKCS12_SAFEBAG_get0_bag_type(const PKCS12_SAFEBAG *bag);
|
---|
136 |
|
---|
137 | X509 *PKCS12_SAFEBAG_get1_cert_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq);
|
---|
138 | X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
|
---|
139 | X509_CRL *PKCS12_SAFEBAG_get1_crl_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq);
|
---|
140 | X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
|
---|
141 | const STACK_OF(PKCS12_SAFEBAG) *
|
---|
142 | PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
|
---|
143 | const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
|
---|
144 | const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
|
---|
145 |
|
---|
146 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
|
---|
147 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
|
---|
148 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype, const unsigned char *value, int len);
|
---|
149 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
|
---|
150 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
|
---|
151 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
|
---|
152 | const char *pass,
|
---|
153 | int passlen,
|
---|
154 | unsigned char *salt,
|
---|
155 | int saltlen, int iter,
|
---|
156 | PKCS8_PRIV_KEY_INFO *p8inf);
|
---|
157 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
|
---|
158 | const char *pass,
|
---|
159 | int passlen,
|
---|
160 | unsigned char *salt,
|
---|
161 | int saltlen, int iter,
|
---|
162 | PKCS8_PRIV_KEY_INFO *p8inf,
|
---|
163 | OSSL_LIB_CTX *ctx,
|
---|
164 | const char *propq);
|
---|
165 |
|
---|
166 | PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
|
---|
167 | int nid1, int nid2);
|
---|
168 | PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass,
|
---|
169 | int passlen);
|
---|
170 | PKCS8_PRIV_KEY_INFO *PKCS8_decrypt_ex(const X509_SIG *p8, const char *pass,
|
---|
171 | int passlen, OSSL_LIB_CTX *ctx,
|
---|
172 | const char *propq);
|
---|
173 | PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
|
---|
174 | const char *pass, int passlen);
|
---|
175 | PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey_ex(const PKCS12_SAFEBAG *bag,
|
---|
176 | const char *pass, int passlen,
|
---|
177 | OSSL_LIB_CTX *ctx,
|
---|
178 | const char *propq);
|
---|
179 | X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
|
---|
180 | const char *pass, int passlen, unsigned char *salt,
|
---|
181 | int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
|
---|
182 | X509_SIG *PKCS8_encrypt_ex(int pbe_nid, const EVP_CIPHER *cipher,
|
---|
183 | const char *pass, int passlen, unsigned char *salt,
|
---|
184 | int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8,
|
---|
185 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
186 | X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen,
|
---|
187 | PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe);
|
---|
188 | X509_SIG *PKCS8_set0_pbe_ex(const char *pass, int passlen,
|
---|
189 | PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe,
|
---|
190 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
191 | PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
|
---|
192 | STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
|
---|
193 | PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
|
---|
194 | unsigned char *salt, int saltlen, int iter,
|
---|
195 | STACK_OF(PKCS12_SAFEBAG) *bags);
|
---|
196 | PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
|
---|
197 | unsigned char *salt, int saltlen, int iter,
|
---|
198 | STACK_OF(PKCS12_SAFEBAG) *bags,
|
---|
199 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
200 |
|
---|
201 | STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
|
---|
202 | int passlen);
|
---|
203 |
|
---|
204 | int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
|
---|
205 | STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);
|
---|
206 |
|
---|
207 | int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
|
---|
208 | int namelen);
|
---|
209 | int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
|
---|
210 | int namelen);
|
---|
211 | int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
|
---|
212 | int namelen);
|
---|
213 | int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
|
---|
214 | int namelen);
|
---|
215 | int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
|
---|
216 | const unsigned char *name, int namelen);
|
---|
217 | int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
|
---|
218 | const unsigned char *bytes, int len);
|
---|
219 | int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
|
---|
220 | const unsigned char *bytes, int len);
|
---|
221 | int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
|
---|
222 | ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
|
---|
223 | int attr_nid);
|
---|
224 | char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
|
---|
225 | const STACK_OF(X509_ATTRIBUTE) *
|
---|
226 | PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
|
---|
227 | void PKCS12_SAFEBAG_set0_attrs(PKCS12_SAFEBAG *bag, STACK_OF(X509_ATTRIBUTE) *attrs);
|
---|
228 | unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor,
|
---|
229 | const char *pass, int passlen,
|
---|
230 | const unsigned char *in, int inlen,
|
---|
231 | unsigned char **data, int *datalen,
|
---|
232 | int en_de);
|
---|
233 | unsigned char *PKCS12_pbe_crypt_ex(const X509_ALGOR *algor,
|
---|
234 | const char *pass, int passlen,
|
---|
235 | const unsigned char *in, int inlen,
|
---|
236 | unsigned char **data, int *datalen,
|
---|
237 | int en_de, OSSL_LIB_CTX *libctx,
|
---|
238 | const char *propq);
|
---|
239 | void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
---|
240 | const char *pass, int passlen,
|
---|
241 | const ASN1_OCTET_STRING *oct, int zbuf);
|
---|
242 | void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
---|
243 | const char *pass, int passlen,
|
---|
244 | const ASN1_OCTET_STRING *oct, int zbuf,
|
---|
245 | OSSL_LIB_CTX *libctx,
|
---|
246 | const char *propq);
|
---|
247 | ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
|
---|
248 | const ASN1_ITEM *it,
|
---|
249 | const char *pass, int passlen,
|
---|
250 | void *obj, int zbuf);
|
---|
251 | ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor,
|
---|
252 | const ASN1_ITEM *it,
|
---|
253 | const char *pass, int passlen,
|
---|
254 | void *obj, int zbuf,
|
---|
255 | OSSL_LIB_CTX *ctx,
|
---|
256 | const char *propq);
|
---|
257 | PKCS12 *PKCS12_init(int mode);
|
---|
258 | PKCS12 *PKCS12_init_ex(int mode, OSSL_LIB_CTX *ctx, const char *propq);
|
---|
259 |
|
---|
260 | int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
|
---|
261 | int saltlen, int id, int iter, int n,
|
---|
262 | unsigned char *out, const EVP_MD *md_type);
|
---|
263 | int PKCS12_key_gen_asc_ex(const char *pass, int passlen, unsigned char *salt,
|
---|
264 | int saltlen, int id, int iter, int n,
|
---|
265 | unsigned char *out, const EVP_MD *md_type,
|
---|
266 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
267 | int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
|
---|
268 | int saltlen, int id, int iter, int n,
|
---|
269 | unsigned char *out, const EVP_MD *md_type);
|
---|
270 | int PKCS12_key_gen_uni_ex(unsigned char *pass, int passlen, unsigned char *salt,
|
---|
271 | int saltlen, int id, int iter, int n,
|
---|
272 | unsigned char *out, const EVP_MD *md_type,
|
---|
273 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
274 | int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
|
---|
275 | int saltlen, int id, int iter, int n,
|
---|
276 | unsigned char *out, const EVP_MD *md_type);
|
---|
277 | int PKCS12_key_gen_utf8_ex(const char *pass, int passlen, unsigned char *salt,
|
---|
278 | int saltlen, int id, int iter, int n,
|
---|
279 | unsigned char *out, const EVP_MD *md_type,
|
---|
280 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
281 |
|
---|
282 | int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
---|
283 | ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
---|
284 | const EVP_MD *md_type, int en_de);
|
---|
285 | int PKCS12_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
---|
286 | ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
---|
287 | const EVP_MD *md_type, int en_de,
|
---|
288 | OSSL_LIB_CTX *libctx, const char *propq);
|
---|
289 | int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
|
---|
290 | unsigned char *mac, unsigned int *maclen);
|
---|
291 | int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
|
---|
292 | int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
|
---|
293 | unsigned char *salt, int saltlen, int iter,
|
---|
294 | const EVP_MD *md_type);
|
---|
295 | int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
|
---|
296 | int saltlen, const EVP_MD *md_type);
|
---|
297 | unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
|
---|
298 | unsigned char **uni, int *unilen);
|
---|
299 | char *OPENSSL_uni2asc(const unsigned char *uni, int unilen);
|
---|
300 | unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
|
---|
301 | unsigned char **uni, int *unilen);
|
---|
302 | char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen);
|
---|
303 |
|
---|
304 | DECLARE_ASN1_FUNCTIONS(PKCS12)
|
---|
305 | DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
|
---|
306 | DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
|
---|
307 | DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
|
---|
308 |
|
---|
309 | DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
|
---|
310 | DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
|
---|
311 |
|
---|
312 | void PKCS12_PBE_add(void);
|
---|
313 | int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
|
---|
314 | STACK_OF(X509) **ca);
|
---|
315 | typedef int PKCS12_create_cb(PKCS12_SAFEBAG *bag, void *cbarg);
|
---|
316 | PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
|
---|
317 | X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
---|
318 | int iter, int mac_iter, int keytype);
|
---|
319 | PKCS12 *PKCS12_create_ex(const char *pass, const char *name, EVP_PKEY *pkey,
|
---|
320 | X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
---|
321 | int iter, int mac_iter, int keytype,
|
---|
322 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
323 | PKCS12 *PKCS12_create_ex2(const char *pass, const char *name, EVP_PKEY *pkey,
|
---|
324 | X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
---|
325 | int iter, int mac_iter, int keytype,
|
---|
326 | OSSL_LIB_CTX *ctx, const char *propq,
|
---|
327 | PKCS12_create_cb *cb, void *cbarg);
|
---|
328 |
|
---|
329 | PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
|
---|
330 | PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
---|
331 | EVP_PKEY *key, int key_usage, int iter,
|
---|
332 | int key_nid, const char *pass);
|
---|
333 | PKCS12_SAFEBAG *PKCS12_add_key_ex(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
---|
334 | EVP_PKEY *key, int key_usage, int iter,
|
---|
335 | int key_nid, const char *pass,
|
---|
336 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
337 |
|
---|
338 | PKCS12_SAFEBAG *PKCS12_add_secret(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
---|
339 | int nid_type, const unsigned char *value, int len);
|
---|
340 | int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
---|
341 | int safe_nid, int iter, const char *pass);
|
---|
342 | int PKCS12_add_safe_ex(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
---|
343 | int safe_nid, int iter, const char *pass,
|
---|
344 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
345 |
|
---|
346 | PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
|
---|
347 | PKCS12 *PKCS12_add_safes_ex(STACK_OF(PKCS7) *safes, int p7_nid,
|
---|
348 | OSSL_LIB_CTX *ctx, const char *propq);
|
---|
349 |
|
---|
350 | int i2d_PKCS12_bio(BIO *bp, const PKCS12 *p12);
|
---|
351 | # ifndef OPENSSL_NO_STDIO
|
---|
352 | int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12);
|
---|
353 | # endif
|
---|
354 | PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
|
---|
355 | # ifndef OPENSSL_NO_STDIO
|
---|
356 | PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
|
---|
357 | # endif
|
---|
358 | int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
|
---|
359 |
|
---|
360 | # ifdef __cplusplus
|
---|
361 | }
|
---|
362 | # endif
|
---|
363 | #endif
|
---|