1d2i_ECPrivateKey(3) OpenSSL d2i_ECPrivateKey(3)
2
3
4
6 i2d_ECPrivateKey, d2i_ECPrivate_key - Encode and decode functions for
7 saving and reading EC_KEY structures
8
10 #include <openssl/ec.h>
11
12 EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
13 int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
14
15 unsigned int EC_KEY_get_enc_flags(const EC_KEY *key);
16 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
17
19 The ECPrivateKey encode and decode routines encode and parse an EC_KEY
20 structure into a binary format (ASN.1 DER) and back again.
21
22 These functions are similar to the d2i_X509() functions, and you should
23 refer to that page for a detailed description (see d2i_X509(3)).
24
25 The format of the external representation of the public key written by
26 i2d_ECPrivateKey (such as whether it is stored in a compressed form or
27 not) is described by the point_conversion_form. See EC_GROUP_copy(3)
28 for a description of point_conversion_form.
29
30 When reading a private key encoded without an associated public key
31 (e.g. if EC_PKEY_NO_PUBKEY has been used - see below), then
32 d2i_ECPrivateKey generates the missing public key automatically.
33 Private keys encoded without parameters (e.g. if EC_PKEY_NO_PARAMETERS
34 has been used - see below) cannot be loaded using d2i_ECPrivateKey.
35
36 The functions EC_KEY_get_enc_flags and EC_KEY_set_enc_flags get and set
37 the value of the encoding flags for the key. There are two encoding
38 flags currently defined - EC_PKEY_NO_PARAMETERS and EC_PKEY_NO_PUBKEY.
39 These flags define the behaviour of how the key is converted into ASN1
40 in a call to i2d_ECPrivateKey. If EC_PKEY_NO_PARAMETERS is set then the
41 public parameters for the curve are not encoded along with the private
42 key. If EC_PKEY_NO_PUBKEY is set then the public key is not encoded
43 along with the private key.
44
46 d2i_ECPrivateKey() returns a valid EC_KEY structure or NULL if an error
47 occurs. The error code that can be obtained by ERR_get_error(3).
48
49 i2d_ECPrivateKey() returns the number of bytes successfully encoded or
50 a negative value if an error occurs. The error code can be obtained by
51 ERR_get_error(3).
52
53 EC_KEY_get_enc_flags returns the value of the current encoding flags
54 for the EC_KEY.
55
57 crypto(3), ec(3), EC_GROUP_new(3), EC_GROUP_copy(3), EC_POINT_new(3),
58 EC_POINT_add(3), EC_GFp_simple_method(3), d2i_ECPKParameters(3),
59 d2i_ECPrivateKey(3)
60
61
62
631.0.2k 2017-01-26 d2i_ECPrivateKey(3)