diff options
author | schwarze <> | 2016-12-26 16:36:34 +0000 |
---|---|---|
committer | schwarze <> | 2016-12-26 16:36:34 +0000 |
commit | 57e1f989d9fcf62c64f0a5143c2213a4c5d321a2 (patch) | |
tree | a46779366b74ad342e705a4224263b910e76e986 | |
parent | cd0dd75586ebcba67ebc915ba3dc601d1a03f33a (diff) | |
download | openbsd-57e1f989d9fcf62c64f0a5143c2213a4c5d321a2.tar.gz openbsd-57e1f989d9fcf62c64f0a5143c2213a4c5d321a2.tar.bz2 openbsd-57e1f989d9fcf62c64f0a5143c2213a4c5d321a2.zip |
Basic cleanup:
Simplify one-line description.
List each function with the correct header file.
Use the same parameter names as in ASN1_item_d2i(3).
Point to ASN1_item_d2i(3) for details.
Sort the text.
Add some useful cross references.
-rw-r--r-- | src/lib/libcrypto/man/d2i_RSAPublicKey.3 | 182 |
1 files changed, 102 insertions, 80 deletions
diff --git a/src/lib/libcrypto/man/d2i_RSAPublicKey.3 b/src/lib/libcrypto/man/d2i_RSAPublicKey.3 index 22d904157f..7a65bed7a4 100644 --- a/src/lib/libcrypto/man/d2i_RSAPublicKey.3 +++ b/src/lib/libcrypto/man/d2i_RSAPublicKey.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: d2i_RSAPublicKey.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $ | 1 | .\" $OpenBSD: d2i_RSAPublicKey.3,v 1.7 2016/12/26 16:36:34 schwarze Exp $ |
2 | .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 | 2 | .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and |
@@ -50,93 +50,97 @@ | |||
50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
52 | .\" | 52 | .\" |
53 | .Dd $Mdocdate: December 25 2016 $ | 53 | .Dd $Mdocdate: December 26 2016 $ |
54 | .Dt D2I_RSAPUBLICKEY 3 | 54 | .Dt D2I_RSAPUBLICKEY 3 |
55 | .Os | 55 | .Os |
56 | .Sh NAME | 56 | .Sh NAME |
57 | .Nm d2i_RSAPublicKey , | 57 | .Nm d2i_RSAPublicKey , |
58 | .Nm i2d_RSAPublicKey , | 58 | .Nm i2d_RSAPublicKey , |
59 | .Nm d2i_RSAPrivateKey , | ||
60 | .Nm i2d_RSAPrivateKey , | ||
61 | .Nm d2i_Netscape_RSA , | ||
62 | .Nm i2d_Netscape_RSA , | ||
59 | .Nm d2i_RSA_PUBKEY , | 63 | .Nm d2i_RSA_PUBKEY , |
60 | .Nm i2d_RSA_PUBKEY , | 64 | .Nm i2d_RSA_PUBKEY , |
61 | .Nm d2i_RSA_PUBKEY_bio , | 65 | .Nm d2i_RSA_PUBKEY_bio , |
62 | .Nm d2i_RSA_PUBKEY_fp , | 66 | .Nm d2i_RSA_PUBKEY_fp , |
63 | .Nm i2d_RSA_PUBKEY_bio , | 67 | .Nm i2d_RSA_PUBKEY_bio , |
64 | .Nm i2d_RSA_PUBKEY_fp , | 68 | .Nm i2d_RSA_PUBKEY_fp |
65 | .Nm d2i_RSAPrivateKey , | 69 | .Nd decode and encode RSA keys |
66 | .Nm i2d_RSAPrivateKey , | ||
67 | .Nm i2d_Netscape_RSA , | ||
68 | .Nm d2i_Netscape_RSA | ||
69 | .Nd RSA public and private key encoding functions | ||
70 | .Sh SYNOPSIS | 70 | .Sh SYNOPSIS |
71 | .In openssl/rsa.h | 71 | .In openssl/rsa.h |
72 | .In openssl/x509.h | ||
73 | .Ft RSA * | 72 | .Ft RSA * |
74 | .Fo d2i_RSAPublicKey | 73 | .Fo d2i_RSAPublicKey |
75 | .Fa "RSA **a" | 74 | .Fa "RSA **val_out" |
76 | .Fa "const unsigned char **pp" | 75 | .Fa "const unsigned char **der_in" |
77 | .Fa "long length" | 76 | .Fa "long length" |
78 | .Fc | 77 | .Fc |
79 | .Ft int | 78 | .Ft int |
80 | .Fo i2d_RSAPublicKey | 79 | .Fo i2d_RSAPublicKey |
81 | .Fa "RSA *a" | 80 | .Fa "RSA *val_in" |
82 | .Fa "unsigned char **pp" | 81 | .Fa "unsigned char **der_out" |
82 | .Fc | ||
83 | .Ft RSA * | ||
84 | .Fo d2i_RSAPrivateKey | ||
85 | .Fa "RSA **val_out" | ||
86 | .Fa "const unsigned char **der_in" | ||
87 | .Fa "long length" | ||
88 | .Fc | ||
89 | .Ft int | ||
90 | .Fo i2d_RSAPrivateKey | ||
91 | .Fa "RSA *val_in" | ||
92 | .Fa "unsigned char **der_out" | ||
93 | .Fc | ||
94 | .Ft RSA * | ||
95 | .Fo d2i_Netscape_RSA | ||
96 | .Fa "RSA **val_out" | ||
97 | .Fa "const unsigned char **der_in" | ||
98 | .Fa "long length" | ||
99 | .Fa "int (*cb)()" | ||
100 | .Fc | ||
101 | .Ft int | ||
102 | .Fo i2d_Netscape_RSA | ||
103 | .Fa "RSA *val_in" | ||
104 | .Fa "unsigned char **der_out" | ||
105 | .Fa "int (*cb)()" | ||
83 | .Fc | 106 | .Fc |
107 | .In openssl/x509.h | ||
84 | .Ft RSA * | 108 | .Ft RSA * |
85 | .Fo d2i_RSA_PUBKEY | 109 | .Fo d2i_RSA_PUBKEY |
86 | .Fa "RSA **a" | 110 | .Fa "RSA **val_out" |
87 | .Fa "const unsigned char **pp" | 111 | .Fa "const unsigned char **der_in" |
88 | .Fa "long length" | 112 | .Fa "long length" |
89 | .Fc | 113 | .Fc |
90 | .Ft int | 114 | .Ft int |
91 | .Fo i2d_RSA_PUBKEY | 115 | .Fo i2d_RSA_PUBKEY |
92 | .Fa "RSA *a" | 116 | .Fa "RSA *val_in" |
93 | .Fa "unsigned char **pp" | 117 | .Fa "unsigned char **der_out" |
94 | .Fc | 118 | .Fc |
95 | .Ft RSA * | 119 | .Ft RSA * |
96 | .Fo d2i_RSA_PUBKEY_bio | 120 | .Fo d2i_RSA_PUBKEY_bio |
97 | .Fa "BIO *bp" | 121 | .Fa "BIO *in_bio" |
98 | .Fa "RSA **a" | 122 | .Fa "RSA **val_out" |
99 | .Fc | 123 | .Fc |
100 | .Ft RSA * | 124 | .Ft RSA * |
101 | .Fo d2i_RSA_PUBKEY_fp | 125 | .Fo d2i_RSA_PUBKEY_fp |
102 | .Fa "FILE *fp" | 126 | .Fa "FILE *in_fp" |
103 | .Fa "RSA **a" | 127 | .Fa "RSA **val_out" |
104 | .Fc | 128 | .Fc |
105 | .Ft int | 129 | .Ft int |
106 | .Fo i2d_RSA_PUBKEY_bio | 130 | .Fo i2d_RSA_PUBKEY_bio |
107 | .Fa "BIO *bp" | 131 | .Fa "BIO *out_bio" |
108 | .Fa "RSA *a" | 132 | .Fa "RSA *val_in" |
109 | .Fc | 133 | .Fc |
110 | .Ft int | 134 | .Ft int |
111 | .Fo i2d_RSA_PUBKEY_fp | 135 | .Fo i2d_RSA_PUBKEY_fp |
112 | .Fa "FILE *fp" | 136 | .Fa "FILE *out_fp" |
113 | .Fa "RSA *a" | 137 | .Fa "RSA *val_in" |
114 | .Fc | ||
115 | .Ft RSA * | ||
116 | .Fo d2i_RSAPrivateKey | ||
117 | .Fa "RSA **a" | ||
118 | .Fa "const unsigned char **pp" | ||
119 | .Fa "long length" | ||
120 | .Fc | ||
121 | .Ft int | ||
122 | .Fo i2d_RSAPrivateKey | ||
123 | .Fa "RSA *a" | ||
124 | .Fa "unsigned char **pp" | ||
125 | .Fc | ||
126 | .Ft int | ||
127 | .Fo i2d_Netscape_RSA | ||
128 | .Fa "RSA *a" | ||
129 | .Fa "unsigned char **pp" | ||
130 | .Fa "int (*cb)()" | ||
131 | .Fc | ||
132 | .Ft RSA * | ||
133 | .Fo d2i_Netscape_RSA | ||
134 | .Fa "RSA **a" | ||
135 | .Fa "const unsigned char **pp" | ||
136 | .Fa "long length" | ||
137 | .Fa "int (*cb)()" | ||
138 | .Fc | 138 | .Fc |
139 | .Sh DESCRIPTION | 139 | .Sh DESCRIPTION |
140 | These functions decode and encode RSA private and public keys. | ||
141 | For details about the semantics, examples, caveats, and bugs, see | ||
142 | .Xr ASN1_item_d2i 3 . | ||
143 | .Pp | ||
140 | .Fn d2i_RSAPublicKey | 144 | .Fn d2i_RSAPublicKey |
141 | and | 145 | and |
142 | .Fn i2d_RSAPublicKey | 146 | .Fn i2d_RSAPublicKey |
@@ -144,55 +148,73 @@ decode and encode a PKCS#1 | |||
144 | .Vt RSAPublicKey | 148 | .Vt RSAPublicKey |
145 | structure. | 149 | structure. |
146 | .Pp | 150 | .Pp |
151 | .Fn d2i_RSAPrivateKey | ||
152 | and | ||
153 | .Fn i2d_RSAPrivateKey | ||
154 | decode and encode a PKCS#1 | ||
155 | .Vt RSAPrivateKey | ||
156 | structure. | ||
157 | The | ||
158 | .Vt RSA | ||
159 | structure passed to the private key encoding functions should have | ||
160 | all the PKCS#1 private key components present. | ||
161 | The data encoded by the private key functions is unencrypted and | ||
162 | therefore offers no private key security. | ||
163 | .Pp | ||
164 | .Fn d2i_Netscape_RSA | ||
165 | and | ||
166 | .Fn i2d_Netscape_RSA | ||
167 | decode and encode an RSA private key in NET format. | ||
168 | These functions are present to provide compatibility with | ||
169 | certain very old software. | ||
170 | The NET format has some severe security weaknesses and should be | ||
171 | avoided if possible. | ||
172 | .Pp | ||
147 | .Fn d2i_RSA_PUBKEY | 173 | .Fn d2i_RSA_PUBKEY |
148 | and | 174 | and |
149 | .Fn i2d_RSA_PUBKEY | 175 | .Fn i2d_RSA_PUBKEY |
150 | decode and encode an RSA public key using an ASN.1 | 176 | decode and encode an RSA public key using an ASN.1 |
151 | .Vt SubjectPublicKeyInfo | 177 | .Vt SubjectPublicKeyInfo |
152 | (certificate public key) structure. | 178 | structure. |
153 | .Pp | ||
154 | .Fn d2i_RSA_PUBKEY_bio , | 179 | .Fn d2i_RSA_PUBKEY_bio , |
155 | .Fn d2i_RSA_PUBKEY_fp , | 180 | .Fn d2i_RSA_PUBKEY_fp , |
156 | .Fn i2d_RSA_PUBKEY_bio , | 181 | .Fn i2d_RSA_PUBKEY_bio , |
157 | and | 182 | and |
158 | .Fn i2d_RSA_PUBKEY_fp | 183 | .Fn i2d_RSA_PUBKEY_fp |
159 | are similar to | 184 | are similar except that they decode or encode using a |
160 | .Fn d2i_RSA_PUBKEY | ||
161 | and | ||
162 | .Fn i2d_RSA_PUBKEY | ||
163 | except that they decode or encode using a | ||
164 | .Vt BIO | 185 | .Vt BIO |
165 | or | 186 | or |
166 | .Vt FILE | 187 | .Vt FILE |
167 | pointer. | 188 | pointer. |
168 | .Pp | 189 | .Sh RETURN VALUES |
190 | .Fn d2i_RSAPublicKey , | ||
169 | .Fn d2i_RSAPrivateKey , | 191 | .Fn d2i_RSAPrivateKey , |
170 | .Fn i2d_RSAPrivateKey | ||
171 | decode and encode a PKCS#1 | ||
172 | .Vt RSAPrivateKey | ||
173 | structure. | ||
174 | .Pp | ||
175 | .Fn d2i_Netscape_RSA , | 192 | .Fn d2i_Netscape_RSA , |
176 | .Fn i2d_Netscape_RSA | 193 | .Fn d2i_RSA_PUBKEY , |
177 | decode and encode an RSA private key in NET format. | 194 | .Fn d2i_RSA_PUBKEY_bio , |
178 | .Pp | ||
179 | The usage of all of these functions is similar to | ||
180 | .Xr d2i_X509 3 | ||
181 | and | 195 | and |
182 | .Xr i2d_X509 3 . | 196 | .Fn d2i_RSA_PUBKEY_fp |
183 | .Pp | 197 | return a valid |
184 | The | ||
185 | .Vt RSA | 198 | .Vt RSA |
186 | structure passed to the private key encoding functions should have all | 199 | object or |
187 | the PKCS#1 private key components present. | 200 | .Dv NULL |
201 | if an error occurs. | ||
188 | .Pp | 202 | .Pp |
189 | The data encoded by the private key functions is unencrypted and | 203 | .Fn i2d_RSAPublicKey , |
190 | therefore offers no private key security. | 204 | .Fn i2d_RSAPrivateKey , |
205 | .Fn i2d_Netscape_RSA , | ||
206 | and | ||
207 | .Fn i2d_RSA_PUBKEY | ||
208 | return the number of bytes successfully encoded or a negative value | ||
209 | if an error occurs. | ||
191 | .Pp | 210 | .Pp |
192 | The NET format functions are present to provide compatibility with | 211 | .Fn i2d_RSA_PUBKEY_bio |
193 | certain very old software. | 212 | and |
194 | This format has some severe security weaknesses and should be avoided if | 213 | .Fn i2d_RSA_PUBKEY_fp |
195 | possible. | 214 | return 1 for success or 0 if an error occurs. |
196 | .Sh SEE ALSO | 215 | .Sh SEE ALSO |
197 | .Xr d2i_X509 3 , | 216 | .Xr ASN1_item_d2i 3 , |
198 | .Xr RSA_new 3 | 217 | .Xr EVP_PKEY_set1_RSA 3 , |
218 | .Xr PEM_write_RSAPrivateKey 3 , | ||
219 | .Xr RSA_new 3 , | ||
220 | .Xr X509_PUBKEY_new 3 | ||