summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/d2i_ECPKParameters.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-05 13:36:33 +0000
committerschwarze <>2016-11-05 13:36:33 +0000
commit71b431bd059aaefaa67b54a34adfaadc4014902c (patch)
tree7bf60aef63735e9638d12b0d8302b14d9860466e /src/lib/libcrypto/man/d2i_ECPKParameters.3
parent5074288f0801a2b426584402e81b5953f706a44f (diff)
downloadopenbsd-71b431bd059aaefaa67b54a34adfaadc4014902c.tar.gz
openbsd-71b431bd059aaefaa67b54a34adfaadc4014902c.tar.bz2
openbsd-71b431bd059aaefaa67b54a34adfaadc4014902c.zip
convert the remaining manual pages from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/d2i_ECPKParameters.3')
-rw-r--r--src/lib/libcrypto/man/d2i_ECPKParameters.3188
1 files changed, 188 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/d2i_ECPKParameters.3 b/src/lib/libcrypto/man/d2i_ECPKParameters.3
new file mode 100644
index 0000000000..71d84b95c9
--- /dev/null
+++ b/src/lib/libcrypto/man/d2i_ECPKParameters.3
@@ -0,0 +1,188 @@
1.Dd $Mdocdate: November 5 2016 $
2.Dt D2I_ECPKPARAMETERS 3
3.Os
4.Sh NAME
5.Nm d2i_ECPKParameters ,
6.Nm i2d_ECPKParameters ,
7.Nm d2i_ECPKParameters_bio ,
8.Nm i2d_ECPKParameters_bio ,
9.Nm d2i_ECPKParameters_fp ,
10.Nm i2d_ECPKParameters_fp ,
11.Nm ECPKParameters_print ,
12.Nm ECPKParameters_print_fp
13.Nd decode and encode ASN.1 representations of elliptic curve entities
14.Sh SYNOPSIS
15.In openssl/ec.h
16.Ft EC_GROUP *
17.Fo d2i_ECPKParameters
18.Fa "EC_GROUP **px"
19.Fa "const unsigned char **in"
20.Fa "long len"
21.Fc
22.Ft int
23.Fo i2d_ECPKParameters
24.Fa "const EC_GROUP *x"
25.Fa "unsigned char **out"
26.Fc
27.Fd #define d2i_ECPKParameters_bio(bp,x)\
28 ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
29.Fd #define i2d_ECPKParameters_bio(bp,x)\
30 ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
31.Fd #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL,\
32 (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
33.Fd #define i2d_ECPKParameters_fp(fp,x)\
34 ASN1_i2d_fp(i2d_ECPKParameters,(fp), (unsigned char *)(x))
35.Ft int
36.Fo ECPKParameters_print
37.Fa "BIO *bp"
38.Fa "const EC_GROUP *x"
39.Fa "int off"
40.Fc
41.Ft int
42.Fo ECPKParameters_print_fp
43.Fa "FILE *fp"
44.Fa "const EC_GROUP *x"
45.Fa "int off"
46.Fc
47.Sh DESCRIPTION
48The ECPKParameters encode and decode routines encode and parse the
49public parameters for an
50.Vt EC_GROUP
51structure, which represents a curve.
52.Pp
53.Fn d2i_ECPKParameters
54attempts to decode
55.Fa len
56bytes at
57.Pf * Fa in .
58If successful, a pointer to the
59.Vt EC_GROUP
60structure is returned.
61If an error occurred, then
62.Dv NULL
63is returned.
64If
65.Fa px
66is not
67.Dv NULL ,
68then the returned structure is written to
69.Pf * Fa px .
70If
71.Pf * Fa px
72is not
73.Dv NULL ,
74then it is assumed that
75.Pf * Fa px
76contains a valid
77.Vt EC_GROUP
78structure and an attempt is made to reuse it.
79If the call is successful,
80.Pf * Fa in
81is incremented to the byte following the parsed data.
82.Pp
83.Fn i2d_ECPKParameters
84encodes the structure pointed to by
85.Fa x
86into DER format.
87If
88.Fa out
89is not
90.Dv NULL ,
91is writes the DER encoded data to the buffer at
92.Pf * Fa out
93and increments it to point after the data just written.
94If the return value is negative, an error occurred, otherwise it returns
95the length of the encoded data.
96.Pp
97If
98.Pf * Fa out
99is
100.Dv NULL ,
101memory will be allocated for a buffer and the encoded data written to it.
102In this case
103.Pf * Fa out
104is not incremented, and it points to the start of the data just written.
105.Pp
106.Fn d2i_ECPKParameters_bio
107is similar to
108.Fn d2i_ECPKParameters
109except it attempts to parse data from
110.Vt BIO
111.Fa bp .
112.Pp
113.Fn d2i_ECPKParameters_fp
114is similar to
115.Fn d2i_ECPKParameters
116except it attempts to parse data from the
117.Vt FILE
118pointer
119.Fa fp .
120.Pp
121.Fn i2d_ECPKParameters_bio
122is similar to
123.Fn i2d_ECPKParameters
124except it writes the encoding of the structure
125.Fa x
126to
127.Vt BIO
128.Fa bp
129and it returns 1 for success or 0 for failure.
130.Pp
131.Fn i2d_ECPKParameters_fp
132is similar to
133.Fn i2d_ECPKParameters
134except it writes the encoding of the structure
135.Fa x
136to
137.Vt BIO
138.Sy bp
139and it returns 1 for success or 0 for failure.
140.Pp
141These functions are very similar to the X.509 functions described in
142.Xr d2i_X509 3 ,
143where further notes and examples are available.
144.Pp
145The
146.Fn ECPKParameters_print
147and
148.Fn ECPKParameters_print_fp
149functions print human-readable output of the public parameters of the
150.Vt EC_GROUP
151to
152.Fa bp
153or
154.Fa fp .
155The output lines are indented by
156.Fa off
157spaces.
158.Sh RETURN VALUES
159.Fn d2i_ECPKParameters ,
160.Fn d2i_ECPKParameters_bio ,
161and
162.Fn d2i_ECPKParameters_fp
163return a valid
164.Vt EC_GROUP
165structure or
166.Dv NULL
167if an error occurs.
168.Pp
169.Fn i2d_ECPKParameters
170returns the number of bytes successfully encoded or a negative value if
171an error occurs.
172.Pp
173.Fn i2d_ECPKParameters_bio ,
174.Fn i2d_ECPKParameters_fp ,
175.Fn ECPKParameters_print ,
176and
177.Fn ECPKParameters_print_fp
178return 1 for success or 0 if an error occurs.
179.Sh SEE ALSO
180.Xr crypto 3 ,
181.Xr d2i_X509 3 ,
182.Xr ec 3 ,
183.Xr EC_GFp_simple_method 3 ,
184.Xr EC_GROUP_copy 3 ,
185.Xr EC_GROUP_new 3 ,
186.Xr EC_KEY_new 3 ,
187.Xr EC_POINT_add 3 ,
188.Xr EC_POINT_new 3