diff options
author | schwarze <> | 2016-11-06 15:57:38 +0000 |
---|---|---|
committer | schwarze <> | 2016-11-06 15:57:38 +0000 |
commit | 559592cd8286c893a54a1f829009cc53325dd6c7 (patch) | |
tree | e150281df72f52c6719db45f4c65b7f845c21fb6 /src/lib/libcrypto/man/d2i_ECPKParameters.3 | |
parent | 9b30976af18b8a407761e020380b9ed595770866 (diff) | |
download | openbsd-559592cd8286c893a54a1f829009cc53325dd6c7.tar.gz openbsd-559592cd8286c893a54a1f829009cc53325dd6c7.tar.bz2 openbsd-559592cd8286c893a54a1f829009cc53325dd6c7.zip |
delete prototypes available in other pages and add two missing .Xr links
Diffstat (limited to 'src/lib/libcrypto/man/d2i_ECPKParameters.3')
-rw-r--r-- | src/lib/libcrypto/man/d2i_ECPKParameters.3 | 192 |
1 files changed, 171 insertions, 21 deletions
diff --git a/src/lib/libcrypto/man/d2i_ECPKParameters.3 b/src/lib/libcrypto/man/d2i_ECPKParameters.3 index 29aaa184a3..640546c763 100644 --- a/src/lib/libcrypto/man/d2i_ECPKParameters.3 +++ b/src/lib/libcrypto/man/d2i_ECPKParameters.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: d2i_ECPKParameters.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: d2i_ECPKParameters.3,v 1.3 2016/11/06 15:57:38 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 6 2016 $ |
4 | .Dt D2I_ECPKPARAMETERS 3 | 4 | .Dt D2I_ECPKPARAMETERS 3 |
@@ -10,8 +10,17 @@ | |||
10 | .Nm i2d_ECPKParameters_bio , | 10 | .Nm i2d_ECPKParameters_bio , |
11 | .Nm d2i_ECPKParameters_fp , | 11 | .Nm d2i_ECPKParameters_fp , |
12 | .Nm i2d_ECPKParameters_fp , | 12 | .Nm i2d_ECPKParameters_fp , |
13 | .Nm d2i_ECParameters , | ||
14 | .Nm i2d_ECParameters , | ||
15 | .Nm ECParameters_dup , | ||
16 | .Nm d2i_ECPrivateKey , | ||
17 | .Nm i2d_ECPrivateKey , | ||
18 | .Nm o2i_ECPublicKey , | ||
19 | .Nm i2o_ECPublicKey , | ||
13 | .Nm ECPKParameters_print , | 20 | .Nm ECPKParameters_print , |
14 | .Nm ECPKParameters_print_fp | 21 | .Nm ECPKParameters_print_fp , |
22 | .Nm ECParameters_print , | ||
23 | .Nm ECParameters_print_fp | ||
15 | .Nd decode and encode ASN.1 representations of elliptic curve entities | 24 | .Nd decode and encode ASN.1 representations of elliptic curve entities |
16 | .Sh SYNOPSIS | 25 | .Sh SYNOPSIS |
17 | .In openssl/ec.h | 26 | .In openssl/ec.h |
@@ -26,14 +35,63 @@ | |||
26 | .Fa "const EC_GROUP *x" | 35 | .Fa "const EC_GROUP *x" |
27 | .Fa "unsigned char **out" | 36 | .Fa "unsigned char **out" |
28 | .Fc | 37 | .Fc |
29 | .Fd #define d2i_ECPKParameters_bio(bp,x)\ | 38 | .Ft EC_GROUP * |
30 | ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) | 39 | .Fo d2i_ECPKParameters_bio |
31 | .Fd #define i2d_ECPKParameters_bio(bp,x)\ | 40 | .Fa "BIO *bp" |
32 | ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) | 41 | .Fa "EC_GROUP **px" |
33 | .Fd #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL,\ | 42 | .Fc |
34 | (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) | 43 | .Ft int |
35 | .Fd #define i2d_ECPKParameters_fp(fp,x)\ | 44 | .Fo i2d_ECPKParameters_bio |
36 | ASN1_i2d_fp(i2d_ECPKParameters,(fp), (unsigned char *)(x)) | 45 | .Fa "BIO *bp" |
46 | .Fa "EC_GROUP **px" | ||
47 | .Fc | ||
48 | .Ft EC_GROUP * | ||
49 | .Fo d2i_ECPKParameters_fp | ||
50 | .Fa "FILE *fp" | ||
51 | .Fa "EC_GROUP **px" | ||
52 | .Fc | ||
53 | .Ft int | ||
54 | .Fo i2d_ECPKParameters_fp | ||
55 | .Fa "FILE *fp" | ||
56 | .Fa "EC_GROUP **px" | ||
57 | .Fc | ||
58 | .Ft EC_KEY * | ||
59 | .Fo d2i_ECParameters | ||
60 | .Fa "EC_KEY **key" | ||
61 | .Fa "const unsigned char **in" | ||
62 | .Fa "long len" | ||
63 | .Fc | ||
64 | .Ft int | ||
65 | .Fo i2d_ECParameters | ||
66 | .Fa "EC_KEY *key" | ||
67 | .Fa "unsigned char **out" | ||
68 | .Fc | ||
69 | .Ft EC_KEY * | ||
70 | .Fo ECParameters_dup | ||
71 | .Fa "EC_KEY *key" | ||
72 | .Fc | ||
73 | .Ft EC_KEY * | ||
74 | .Fo d2i_ECPrivateKey | ||
75 | .Fa "EC_KEY **key" | ||
76 | .Fa "const unsigned char **in" | ||
77 | .Fa "long len" | ||
78 | .Fc | ||
79 | .Ft int | ||
80 | .Fo i2d_ECPrivateKey | ||
81 | .Fa "EC_KEY *key" | ||
82 | .Fa "unsigned char **out" | ||
83 | .Fc | ||
84 | .Ft EC_KEY * | ||
85 | .Fo o2i_ECPublicKey | ||
86 | .Fa "EC_KEY **key" | ||
87 | .Fa "const unsigned char **in" | ||
88 | .Fa "long len" | ||
89 | .Fc | ||
90 | .Ft int | ||
91 | .Fo i2o_ECPublicKey | ||
92 | .Fa "EC_KEY *key" | ||
93 | .Fa "unsigned char **out" | ||
94 | .Fc | ||
37 | .Ft int | 95 | .Ft int |
38 | .Fo ECPKParameters_print | 96 | .Fo ECPKParameters_print |
39 | .Fa "BIO *bp" | 97 | .Fa "BIO *bp" |
@@ -46,12 +104,17 @@ | |||
46 | .Fa "const EC_GROUP *x" | 104 | .Fa "const EC_GROUP *x" |
47 | .Fa "int off" | 105 | .Fa "int off" |
48 | .Fc | 106 | .Fc |
107 | .Ft int | ||
108 | .Fo ECParameters_print | ||
109 | .Fa "BIO *bp" | ||
110 | .Fa "const EC_KEY *key" | ||
111 | .Fc | ||
112 | .Ft int | ||
113 | .Fo ECParameters_print_fp | ||
114 | .Fa "FILE *fp" | ||
115 | .Fa "const EC_KEY *key" | ||
116 | .Fc | ||
49 | .Sh DESCRIPTION | 117 | .Sh DESCRIPTION |
50 | The ECPKParameters encode and decode routines encode and parse the | ||
51 | public parameters for an | ||
52 | .Vt EC_GROUP | ||
53 | structure, which represents a curve. | ||
54 | .Pp | ||
55 | .Fn d2i_ECPKParameters | 118 | .Fn d2i_ECPKParameters |
56 | attempts to decode | 119 | attempts to decode |
57 | .Fa len | 120 | .Fa len |
@@ -111,7 +174,6 @@ is similar to | |||
111 | except it attempts to parse data from | 174 | except it attempts to parse data from |
112 | .Vt BIO | 175 | .Vt BIO |
113 | .Fa bp . | 176 | .Fa bp . |
114 | .Pp | ||
115 | .Fn d2i_ECPKParameters_fp | 177 | .Fn d2i_ECPKParameters_fp |
116 | is similar to | 178 | is similar to |
117 | .Fn d2i_ECPKParameters | 179 | .Fn d2i_ECPKParameters |
@@ -119,7 +181,6 @@ except it attempts to parse data from the | |||
119 | .Vt FILE | 181 | .Vt FILE |
120 | pointer | 182 | pointer |
121 | .Fa fp . | 183 | .Fa fp . |
122 | .Pp | ||
123 | .Fn i2d_ECPKParameters_bio | 184 | .Fn i2d_ECPKParameters_bio |
124 | is similar to | 185 | is similar to |
125 | .Fn i2d_ECPKParameters | 186 | .Fn i2d_ECPKParameters |
@@ -129,7 +190,6 @@ to | |||
129 | .Vt BIO | 190 | .Vt BIO |
130 | .Fa bp | 191 | .Fa bp |
131 | and it returns 1 for success or 0 for failure. | 192 | and it returns 1 for success or 0 for failure. |
132 | .Pp | ||
133 | .Fn i2d_ECPKParameters_fp | 193 | .Fn i2d_ECPKParameters_fp |
134 | is similar to | 194 | is similar to |
135 | .Fn i2d_ECPKParameters | 195 | .Fn i2d_ECPKParameters |
@@ -139,6 +199,69 @@ to | |||
139 | .Vt BIO | 199 | .Vt BIO |
140 | .Sy bp | 200 | .Sy bp |
141 | and it returns 1 for success or 0 for failure. | 201 | and it returns 1 for success or 0 for failure. |
202 | These four functions are currently implemented as macros. | ||
203 | .Pp | ||
204 | .Fn d2i_ECParameters | ||
205 | does the same parsing as | ||
206 | .Fn d2i_ECPKParameters | ||
207 | but saves the result in the | ||
208 | .Fa group | ||
209 | field of an | ||
210 | .Vt EC_KEY | ||
211 | structure. | ||
212 | .Pp | ||
213 | .Fn i2d_ECParameters | ||
214 | produces the same output as | ||
215 | .Fn i2d_ECPKParameters | ||
216 | but uses | ||
217 | .Fa key->group | ||
218 | for input instead of | ||
219 | .Fa px . | ||
220 | .Pp | ||
221 | .Fn ECParameters_dup | ||
222 | copies | ||
223 | .Fa key | ||
224 | by calling | ||
225 | .Fn i2d_ECParameters | ||
226 | and | ||
227 | .Fn d2i_ECParameters . | ||
228 | .Pp | ||
229 | .Fn d2i_ECPrivateKey | ||
230 | interprets | ||
231 | .Fa len | ||
232 | bytes at | ||
233 | .Fa in | ||
234 | as a DER-encoded private key, decodes it, stores the result in | ||
235 | .Fa key | ||
236 | as described above, and returns a pointer to it. | ||
237 | .Pp | ||
238 | .Fn i2d_ECPrivateKey | ||
239 | encodes the private key | ||
240 | .Fa a | ||
241 | into DER format and writes it to | ||
242 | .Fa out | ||
243 | as described above. | ||
244 | .Pp | ||
245 | .Fn o2i_ECPublicKey | ||
246 | takes a string of | ||
247 | .Fa len | ||
248 | octets from | ||
249 | .Fa in , | ||
250 | decodes them, and stores the resulting EC public key in the existing | ||
251 | .Pf * Fa key. | ||
252 | .Pp | ||
253 | .Fn i2o_ECPublicKey | ||
254 | encodes the public | ||
255 | .Fa key | ||
256 | into the octet string buffer | ||
257 | .Pf * Fa out . | ||
258 | If | ||
259 | .Pf * Fa out | ||
260 | is | ||
261 | .Dv NULL , | ||
262 | a new buffer of the required size is allocated; | ||
263 | otherwise, the pointer is advanced to point to the octet | ||
264 | after the last one written. | ||
142 | .Pp | 265 | .Pp |
143 | These functions are very similar to the X.509 functions described in | 266 | These functions are very similar to the X.509 functions described in |
144 | .Xr d2i_X509 3 , | 267 | .Xr d2i_X509 3 , |
@@ -157,6 +280,16 @@ or | |||
157 | The output lines are indented by | 280 | The output lines are indented by |
158 | .Fa off | 281 | .Fa off |
159 | spaces. | 282 | spaces. |
283 | .Pp | ||
284 | .Fn ECParameters_print | ||
285 | and | ||
286 | .Fn ECParameters_print_fp | ||
287 | print the parameter components of | ||
288 | .Fa key | ||
289 | to | ||
290 | .Fa bp | ||
291 | or | ||
292 | .Fa fp . | ||
160 | .Sh RETURN VALUES | 293 | .Sh RETURN VALUES |
161 | .Fn d2i_ECPKParameters , | 294 | .Fn d2i_ECPKParameters , |
162 | .Fn d2i_ECPKParameters_bio , | 295 | .Fn d2i_ECPKParameters_bio , |
@@ -168,15 +301,32 @@ structure or | |||
168 | .Dv NULL | 301 | .Dv NULL |
169 | if an error occurs. | 302 | if an error occurs. |
170 | .Pp | 303 | .Pp |
171 | .Fn i2d_ECPKParameters | 304 | .Fn d2i_ECParameters , |
172 | returns the number of bytes successfully encoded or a negative value if | 305 | .Fn ECParameters_dup , |
306 | .Fn d2i_ECPrivateKey , | ||
307 | and | ||
308 | .Fn o2i_ECPublicKey | ||
309 | return a valid | ||
310 | .Vt EC_KEY | ||
311 | structure or | ||
312 | .Dv NULL | ||
313 | if an error occurs. | ||
314 | .Pp | ||
315 | .Fn i2d_ECPKParameters , | ||
316 | .Fn i2d_ECParameters , | ||
317 | .Fn i2d_ECPrivateKey , | ||
318 | and | ||
319 | .Fn i2o_ECPublicKey | ||
320 | return the number of bytes successfully encoded or a negative value if | ||
173 | an error occurs. | 321 | an error occurs. |
174 | .Pp | 322 | .Pp |
175 | .Fn i2d_ECPKParameters_bio , | 323 | .Fn i2d_ECPKParameters_bio , |
176 | .Fn i2d_ECPKParameters_fp , | 324 | .Fn i2d_ECPKParameters_fp , |
177 | .Fn ECPKParameters_print , | 325 | .Fn ECPKParameters_print , |
326 | .Fn ECPKParameters_print_fp , | ||
327 | .Fn ECParameters_print , | ||
178 | and | 328 | and |
179 | .Fn ECPKParameters_print_fp | 329 | .Fn ECParameters_print_fp |
180 | return 1 for success or 0 if an error occurs. | 330 | return 1 for success or 0 if an error occurs. |
181 | .Sh SEE ALSO | 331 | .Sh SEE ALSO |
182 | .Xr crypto 3 , | 332 | .Xr crypto 3 , |