1d2i_ECPKParameters(3)               OpenSSL              d2i_ECPKParameters(3)
2
3
4

NAME

6       d2i_ECPKParameters, i2d_ECPKParameters, d2i_ECPKParameters_bio,
7       i2d_ECPKParameters_bio, d2i_ECPKParameters_fp, i2d_ECPKParameters_fp,
8       ECPKParameters_print, ECPKParameters_print_fp - Functions for decoding
9       and encoding ASN1 representations of elliptic curve entities
10

SYNOPSIS

12        #include <openssl/ec.h>
13
14        EC_GROUP *d2i_ECPKParameters(EC_GROUP **px, const unsigned char **in, long len);
15        int i2d_ECPKParameters(const EC_GROUP *x, unsigned char **out);
16        #define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
17        #define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
18        #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
19                       (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
20        #define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
21                       (unsigned char *)(x))
22        int     ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
23        int     ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
24

DESCRIPTION

26       The ECPKParameters encode and decode routines encode and parse the
27       public parameters for an EC_GROUP structure, which represents a curve.
28
29       d2i_ECPKParameters() attempts to decode len bytes at *in. If successful
30       a pointer to the EC_GROUP structure is returned. If an error occurred
31       then NULL is returned. If px is not NULL then the returned structure is
32       written to *px. If *px is not NULL then it is assumed that *px contains
33       a valid EC_GROUP structure and an attempt is made to reuse it. If the
34       call is successful *in is incremented to the byte following the parsed
35       data.
36
37       i2d_ECPKParameters() encodes the structure pointed to by x into DER
38       format.  If out is not NULL is writes the DER encoded data to the
39       buffer at *out, and increments it to point after the data just written.
40       If the return value is negative an error occurred, otherwise it returns
41       the length of the encoded data.
42
43       If *out is NULL memory will be allocated for a buffer and the encoded
44       data written to it. In this case *out is not incremented and it points
45       to the start of the data just written.
46
47       d2i_ECPKParameters_bio() is similar to d2i_ECPKParameters() except it
48       attempts to parse data from BIO bp.
49
50       d2i_ECPKParameters_fp() is similar to d2i_ECPKParameters() except it
51       attempts to parse data from FILE pointer fp.
52
53       i2d_ECPKParameters_bio() is similar to i2d_ECPKParameters() except it
54       writes the encoding of the structure x to BIO bp and it returns 1 for
55       success and 0 for failure.
56
57       i2d_ECPKParameters_fp() is similar to i2d_ECPKParameters() except it
58       writes the encoding of the structure x to BIO bp and it returns 1 for
59       success and 0 for failure.
60
61       These functions are very similar to the X509 functions described in
62       d2i_X509(3), where further notes and examples are available.
63
64       The ECPKParameters_print and ECPKParameters_print_fp functions print a
65       human-readable output of the public parameters of the EC_GROUP to bp or
66       fp. The output lines are indented by off spaces.
67

RETURN VALUES

69       d2i_ECPKParameters(), d2i_ECPKParameters_bio() and
70       d2i_ECPKParameters_fp() return a valid EC_GROUP structure or NULL if an
71       error occurs.
72
73       i2d_ECPKParameters() returns the number of bytes successfully encoded
74       or a negative value if an error occurs.
75
76       i2d_ECPKParameters_bio(), i2d_ECPKParameters_fp(), ECPKParameters_print
77       and ECPKParameters_print_fp return 1 for success and 0 if an error
78       occurs.
79

SEE ALSO

81       crypto(3), ec(3), EC_GROUP_new(3), EC_GROUP_copy(3), EC_POINT_new(3),
82       EC_POINT_add(3), EC_KEY_new(3), EC_GFp_simple_method(3), d2i_X509(3)
83
84
85
861.0.2o                            2020-08-01             d2i_ECPKParameters(3)
Impressum