1PKCS12_SAFEBAG_CREATE_CERT(3ossl) OpenSSL PKCS12_SAFEBAG_CREATE_CERT(3ossl)
2
3
4
6 PKCS12_SAFEBAG_create_cert, PKCS12_SAFEBAG_create_crl,
7 PKCS12_SAFEBAG_create_secret, PKCS12_SAFEBAG_create0_p8inf,
8 PKCS12_SAFEBAG_create0_pkcs8, PKCS12_SAFEBAG_create_pkcs8_encrypt,
9 PKCS12_SAFEBAG_create_pkcs8_encrypt_ex - Create PKCS#12 safeBag objects
10
12 #include <openssl/pkcs12.h>
13
14 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
15 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
16 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype,
17 const unsigned char* value,
18 int len);
19 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
20 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
21 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
22 const char *pass,
23 int passlen,
24 unsigned char *salt,
25 int saltlen, int iter,
26 PKCS8_PRIV_KEY_INFO *p8inf);
27 PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
28 const char *pass,
29 int passlen,
30 unsigned char *salt,
31 int saltlen, int iter,
32 PKCS8_PRIV_KEY_INFO *p8inf,
33 OSSL_LIB_CTX *ctx,
34 const char *propq);
35
37 PKCS12_SAFEBAG_create_cert() creates a new PKCS12_SAFEBAG of type
38 NID_certBag containing the supplied certificate.
39
40 PKCS12_SAFEBAG_create_crl() creates a new PKCS12_SAFEBAG of type
41 NID_crlBag containing the supplied crl.
42
43 PKCS12_SAFEBAG_create_secret() creates a new PKCS12_SAFEBAG of type
44 corresponding to a PKCS#12 secretBag. The secretBag contents are tagged
45 as type with an ASN1 value of type vtype constructed using the bytes in
46 value of length len.
47
48 PKCS12_SAFEBAG_create0_p8inf() creates a new PKCS12_SAFEBAG of type
49 NID_keyBag containing the supplied PKCS8 structure.
50
51 PKCS12_SAFEBAG_create0_pkcs8() creates a new PKCS12_SAFEBAG of type
52 NID_pkcs8ShroudedKeyBag containing the supplied PKCS8 structure.
53
54 PKCS12_SAFEBAG_create_pkcs8_encrypt() creates a new PKCS12_SAFEBAG of
55 type NID_pkcs8ShroudedKeyBag by encrypting the supplied PKCS8 p8inf.
56 If pbe_nid is 0, a default encryption algorithm is used. pass is the
57 passphrase and iter is the iteration count. If iter is zero then a
58 default value of 2048 is used. If salt is NULL then a salt is generated
59 randomly.
60
61 PKCS12_SAFEBAG_create_pkcs8_encrypt_ex() is identical to
62 PKCS12_SAFEBAG_create_pkcs8_encrypt() but allows for a library context
63 ctx and property query propq to be used to select algorithm
64 implementations.
65
67 PKCS12_SAFEBAG_create_pkcs8_encrypt() makes assumptions regarding the
68 encoding of the given pass phrase. See passphrase-encoding(7) for more
69 information.
70
71 PKCS12_SAFEBAG_create_secret() was added in OpenSSL 3.0.
72
74 All of these functions return a valid PKCS12_SAFEBAG structure or NULL
75 if an error occurred.
76
78 IETF RFC 7292 (<https://tools.ietf.org/html/rfc7292>)
79
81 PKCS12_create(3), PKCS12_add_safe(3), PKCS12_add_safes(3)
82
84 PKCS12_SAFEBAG_create_pkcs8_encrypt_ex() was added in OpenSSL 3.0.
85
87 Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
88
89 Licensed under the Apache License 2.0 (the "License"). You may not use
90 this file except in compliance with the License. You can obtain a copy
91 in the file LICENSE in the source distribution or at
92 <https://www.openssl.org/source/license.html>.
93
94
95
963.0.5 2022-11-01 PKCS12_SAFEBAG_CREATE_CERT(3ossl)