| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "PKCS12_SAFEBAG_CREATE_CERT 3SSL" |
| 58 |
.TH PKCS12_SAFEBAG_CREATE_CERT 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
PKCS12_SAFEBAG_create_cert, PKCS12_SAFEBAG_create_crl, |
| 65 |
PKCS12_SAFEBAG_create_secret, PKCS12_SAFEBAG_create0_p8inf, |
| 66 |
PKCS12_SAFEBAG_create0_pkcs8, PKCS12_SAFEBAG_create_pkcs8_encrypt, |
| 67 |
PKCS12_SAFEBAG_create_pkcs8_encrypt_ex \- Create PKCS#12 safeBag objects |
| 68 |
.SH SYNOPSIS |
| 69 |
.IX Header "SYNOPSIS" |
| 70 |
.Vb 1 |
| 71 |
\& #include <openssl/pkcs12.h> |
| 72 |
\& |
| 73 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509); |
| 74 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl); |
| 75 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype, |
| 76 |
\& const unsigned char* value, |
| 77 |
\& int len); |
| 78 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8); |
| 79 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8); |
| 80 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid, |
| 81 |
\& const char *pass, |
| 82 |
\& int passlen, |
| 83 |
\& unsigned char *salt, |
| 84 |
\& int saltlen, int iter, |
| 85 |
\& PKCS8_PRIV_KEY_INFO *p8inf); |
| 86 |
\& PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid, |
| 87 |
\& const char *pass, |
| 88 |
\& int passlen, |
| 89 |
\& unsigned char *salt, |
| 90 |
\& int saltlen, int iter, |
| 91 |
\& PKCS8_PRIV_KEY_INFO *p8inf, |
| 92 |
\& OSSL_LIB_CTX *ctx, |
| 93 |
\& const char *propq); |
| 94 |
.Ve |
| 95 |
.SH DESCRIPTION |
| 96 |
.IX Header "DESCRIPTION" |
| 97 |
\&\fBPKCS12_SAFEBAG_create_cert()\fR creates a new \fBPKCS12_SAFEBAG\fR of type \fBNID_certBag\fR |
| 98 |
containing the supplied certificate. |
| 99 |
.PP |
| 100 |
\&\fBPKCS12_SAFEBAG_create_crl()\fR creates a new \fBPKCS12_SAFEBAG\fR of type \fBNID_crlBag\fR |
| 101 |
containing the supplied crl. |
| 102 |
.PP |
| 103 |
\&\fBPKCS12_SAFEBAG_create_secret()\fR creates a new \fBPKCS12_SAFEBAG\fR of type |
| 104 |
corresponding to a PKCS#12 \fBsecretBag\fR. The \fBsecretBag\fR contents are tagged as |
| 105 |
\&\fItype\fR with an ASN1 value of type \fIvtype\fR constructed using the bytes in |
| 106 |
\&\fIvalue\fR of length \fIlen\fR. |
| 107 |
.PP |
| 108 |
\&\fBPKCS12_SAFEBAG_create0_p8inf()\fR creates a new \fBPKCS12_SAFEBAG\fR of type \fBNID_keyBag\fR |
| 109 |
containing the supplied PKCS8 structure. |
| 110 |
.PP |
| 111 |
\&\fBPKCS12_SAFEBAG_create0_pkcs8()\fR creates a new \fBPKCS12_SAFEBAG\fR of type |
| 112 |
\&\fBNID_pkcs8ShroudedKeyBag\fR containing the supplied PKCS8 structure. |
| 113 |
.PP |
| 114 |
\&\fBPKCS12_SAFEBAG_create_pkcs8_encrypt()\fR creates a new \fBPKCS12_SAFEBAG\fR of type |
| 115 |
\&\fBNID_pkcs8ShroudedKeyBag\fR by encrypting the supplied PKCS8 \fIp8inf\fR. |
| 116 |
If \fIpbe_nid\fR is 0, a default encryption algorithm is used. \fIpass\fR is the |
| 117 |
passphrase and \fIiter\fR is the iteration count. If \fIiter\fR is zero then a default |
| 118 |
value of 2048 is used. If \fIsalt\fR is NULL then a salt is generated randomly. |
| 119 |
.PP |
| 120 |
\&\fBPKCS12_SAFEBAG_create_pkcs8_encrypt_ex()\fR is identical to \fBPKCS12_SAFEBAG_create_pkcs8_encrypt()\fR |
| 121 |
but allows for a library context \fIctx\fR and property query \fIpropq\fR to be used to select |
| 122 |
algorithm implementations. |
| 123 |
.SH NOTES |
| 124 |
.IX Header "NOTES" |
| 125 |
\&\fBPKCS12_SAFEBAG_create_pkcs8_encrypt()\fR makes assumptions regarding the encoding of the given pass |
| 126 |
phrase. |
| 127 |
See \fBpassphrase\-encoding\fR\|(7) for more information. |
| 128 |
.PP |
| 129 |
\&\fBPKCS12_SAFEBAG_create_secret()\fR was added in OpenSSL 3.0. |
| 130 |
.SH "RETURN VALUES" |
| 131 |
.IX Header "RETURN VALUES" |
| 132 |
All of these functions return a valid \fBPKCS12_SAFEBAG\fR structure or NULL if an error occurred. |
| 133 |
.SH "CONFORMING TO" |
| 134 |
.IX Header "CONFORMING TO" |
| 135 |
IETF RFC 7292 (<https://tools.ietf.org/html/rfc7292>) |
| 136 |
.SH "SEE ALSO" |
| 137 |
.IX Header "SEE ALSO" |
| 138 |
\&\fBPKCS12_create\fR\|(3), |
| 139 |
\&\fBPKCS12_add_safe\fR\|(3), |
| 140 |
\&\fBPKCS12_add_safes\fR\|(3) |
| 141 |
.SH HISTORY |
| 142 |
.IX Header "HISTORY" |
| 143 |
\&\fBPKCS12_SAFEBAG_create_pkcs8_encrypt_ex()\fR was added in OpenSSL 3.0. |
| 144 |
.SH COPYRIGHT |
| 145 |
.IX Header "COPYRIGHT" |
| 146 |
Copyright 2019\-2021 The OpenSSL Project Authors. All Rights Reserved. |
| 147 |
.PP |
| 148 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 149 |
this file except in compliance with the License. You can obtain a copy |
| 150 |
in the file LICENSE in the source distribution or at |
| 151 |
<https://www.openssl.org/source/license.html>. |