d2i_PrivateKey.3 (340704) | d2i_PrivateKey.3 (344604) |
---|---|
1.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) | 1.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) |
2.\" 3.\" Standard preamble: 4.\" ======================================================================== 5.de Sp \" Vertical space (when we can't use .PP) 6.if t .sp .5v 7.if n .sp 8.. 9.de Vb \" Begin verbatim text --- 39 unchanged lines hidden (view full) --- 49.\" If the F register is >0, we'll generate index entries on stderr for 50.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index 51.\" entries marked with X<> in POD. Of course, you'll have to process the 52.\" output yourself in some meaningful fashion. 53.\" 54.\" Avoid warning from groff about undefined register 'F'. 55.de IX 56.. | 2.\" 3.\" Standard preamble: 4.\" ======================================================================== 5.de Sp \" Vertical space (when we can't use .PP) 6.if t .sp .5v 7.if n .sp 8.. 9.de Vb \" Begin verbatim text --- 39 unchanged lines hidden (view full) --- 49.\" If the F register is >0, we'll generate index entries on stderr for 50.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index 51.\" entries marked with X<> in POD. Of course, you'll have to process the 52.\" output yourself in some meaningful fashion. 53.\" 54.\" Avoid warning from groff about undefined register 'F'. 55.de IX 56.. |
57.if !\nF .nr F 0 58.if \nF>0 \{\ 59. de IX 60. tm Index:\\$1\t\\n%\t"\\$2" | 57.nr rF 0 58.if \n(.g .if rF .nr rF 1 59.if (\n(rF:(\n(.g==0)) \{\ 60. if \nF \{\ 61. de IX 62. tm Index:\\$1\t\\n%\t"\\$2" |
61.. | 63.. |
62. if !\nF==2 \{\ 63. nr % 0 64. nr F 2 | 64. if !\nF==2 \{\ 65. nr % 0 66. nr F 2 67. \} |
65. \} 66.\} | 68. \} 69.\} |
70.rr rF |
|
67.\" 68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 69.\" Fear. Run. Save yourself. No user-serviceable parts. 70. \" fudge factors for nroff and troff 71.if n \{\ 72. ds #H 0 73. ds #V .8m 74. ds #F .3m --- 49 unchanged lines hidden (view full) --- 124. ds Th \o'LP' 125. ds ae ae 126. ds Ae AE 127.\} 128.rm #[ #] #H #V #F C 129.\" ======================================================================== 130.\" 131.IX Title "d2i_PrivateKey 3" | 71.\" 72.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 73.\" Fear. Run. Save yourself. No user-serviceable parts. 74. \" fudge factors for nroff and troff 75.if n \{\ 76. ds #H 0 77. ds #V .8m 78. ds #F .3m --- 49 unchanged lines hidden (view full) --- 128. ds Th \o'LP' 129. ds ae ae 130. ds Ae AE 131.\} 132.rm #[ #] #H #V #F C 133.\" ======================================================================== 134.\" 135.IX Title "d2i_PrivateKey 3" |
132.TH d2i_PrivateKey 3 "2018-11-20" "1.0.2q" "OpenSSL" | 136.TH d2i_PrivateKey 3 "2019-02-26" "1.0.2r" "OpenSSL" |
133.\" For nroff, turn off justification. Always turn off hyphenation; it makes 134.\" way too many mistakes in technical documents. 135.if n .ad l 136.nh 137.SH "NAME" 138d2i_Private_key, d2i_AutoPrivateKey, i2d_PrivateKey \- decode and encode 139functions for reading and saving EVP_PKEY structures. 140.SH "SYNOPSIS" --- 4 unchanged lines hidden (view full) --- 145\& EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, 146\& long length); 147\& EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, 148\& long length); 149\& int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); 150.Ve 151.SH "DESCRIPTION" 152.IX Header "DESCRIPTION" | 137.\" For nroff, turn off justification. Always turn off hyphenation; it makes 138.\" way too many mistakes in technical documents. 139.if n .ad l 140.nh 141.SH "NAME" 142d2i_Private_key, d2i_AutoPrivateKey, i2d_PrivateKey \- decode and encode 143functions for reading and saving EVP_PKEY structures. 144.SH "SYNOPSIS" --- 4 unchanged lines hidden (view full) --- 149\& EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, 150\& long length); 151\& EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, 152\& long length); 153\& int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); 154.Ve 155.SH "DESCRIPTION" 156.IX Header "DESCRIPTION" |
153\&\fId2i_PrivateKey()\fR decodes a private key using algorithm \fBtype\fR. It attempts to | 157\&\fBd2i_PrivateKey()\fR decodes a private key using algorithm \fBtype\fR. It attempts to |
154use any key specific format or PKCS#8 unencrypted PrivateKeyInfo format. The 155\&\fBtype\fR parameter should be a public key algorithm constant such as 156\&\fB\s-1EVP_PKEY_RSA\s0\fR. An error occurs if the decoded key does not match \fBtype\fR. 157.PP | 158use any key specific format or PKCS#8 unencrypted PrivateKeyInfo format. The 159\&\fBtype\fR parameter should be a public key algorithm constant such as 160\&\fB\s-1EVP_PKEY_RSA\s0\fR. An error occurs if the decoded key does not match \fBtype\fR. 161.PP |
158\&\fId2i_AutoPrivateKey()\fR is similar to \fId2i_PrivateKey()\fR except it attempts to | 162\&\fBd2i_AutoPrivateKey()\fR is similar to \fBd2i_PrivateKey()\fR except it attempts to |
159automatically detect the private key format. 160.PP | 163automatically detect the private key format. 164.PP |
161\&\fIi2d_PrivateKey()\fR encodes \fBkey\fR. It uses a key specific format or, if none is | 165\&\fBi2d_PrivateKey()\fR encodes \fBkey\fR. It uses a key specific format or, if none is |
162defined for that key type, PKCS#8 unencrypted PrivateKeyInfo format. 163.PP | 166defined for that key type, PKCS#8 unencrypted PrivateKeyInfo format. 167.PP |
164These functions are similar to the \fId2i_X509()\fR functions, and you should refer to 165that page for a detailed description (see \fId2i_X509\fR\|(3)). | 168These functions are similar to the \fBd2i_X509()\fR functions, and you should refer to 169that page for a detailed description (see \fBd2i_X509\fR\|(3)). |
166.SH "NOTES" 167.IX Header "NOTES" 168All these functions use \s-1DER\s0 format and unencrypted keys. Applications wishing 169to encrypt or decrypt private keys should use other functions such as | 170.SH "NOTES" 171.IX Header "NOTES" 172All these functions use \s-1DER\s0 format and unencrypted keys. Applications wishing 173to encrypt or decrypt private keys should use other functions such as |
170\&\fId2i_PKC8PrivateKey()\fR instead. | 174\&\fBd2i_PKC8PrivateKey()\fR instead. |
171.PP | 175.PP |
172If the \fB*a\fR is not \s-1NULL\s0 when calling \fId2i_PrivateKey()\fR or \fId2i_AutoPrivateKey()\fR | 176If the \fB*a\fR is not \s-1NULL\s0 when calling \fBd2i_PrivateKey()\fR or \fBd2i_AutoPrivateKey()\fR |
173(i.e. an existing structure is being reused) and the key format is PKCS#8 174then \fB*a\fR will be freed and replaced on a successful call. 175.SH "RETURN VALUES" 176.IX Header "RETURN VALUES" | 177(i.e. an existing structure is being reused) and the key format is PKCS#8 178then \fB*a\fR will be freed and replaced on a successful call. 179.SH "RETURN VALUES" 180.IX Header "RETURN VALUES" |
177\&\fId2i_PrivateKey()\fR and \fId2i_AutoPrivateKey()\fR return a valid \fB\s-1EVP_KEY\s0\fR structure | 181\&\fBd2i_PrivateKey()\fR and \fBd2i_AutoPrivateKey()\fR return a valid \fB\s-1EVP_KEY\s0\fR structure |
178or \fB\s-1NULL\s0\fR if an error occurs. The error code can be obtained by calling | 182or \fB\s-1NULL\s0\fR if an error occurs. The error code can be obtained by calling |
179\&\fIERR_get_error\fR\|(3). | 183\&\fBERR_get_error\fR\|(3). |
180.PP | 184.PP |
181\&\fIi2d_PrivateKey()\fR returns the number of bytes successfully encoded or a | 185\&\fBi2d_PrivateKey()\fR returns the number of bytes successfully encoded or a |
182negative value if an error occurs. The error code can be obtained by calling | 186negative value if an error occurs. The error code can be obtained by calling |
183\&\fIERR_get_error\fR\|(3). | 187\&\fBERR_get_error\fR\|(3). |
184.SH "SEE ALSO" 185.IX Header "SEE ALSO" | 188.SH "SEE ALSO" 189.IX Header "SEE ALSO" |
186\&\fIcrypto\fR\|(3), 187\&\fId2i_PKCS8PrivateKey\fR\|(3) | 190\&\fBcrypto\fR\|(3), 191\&\fBd2i_PKCS8PrivateKey\fR\|(3) |