d2i_ECPrivateKey(3) OpenSSL d2i_ECPrivateKey(3) NNAAMMEE i2d_ECPrivateKey, d2i_ECPrivate_key - Encode and decode functions for saving and reading EC_KEY structures SSYYNNOOPPSSIISS #include EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len); int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out); unsigned int EC_KEY_get_enc_flags(const EC_KEY *key); void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags); DDEESSCCRRIIPPTTIIOONN The ECPrivateKey encode and decode routines encode and parse an EECC__KKEEYY structure into a binary format (ASN.1 DER) and back again. These functions are similar to the _d_2_i___X_5_0_9_(_) functions, and you should refer to that page for a detailed description (see _d_2_i___X_5_0_9(3)). The format of the external representation of the public key written by i2d_ECPrivateKey (such as whether it is stored in a compressed form or not) is described by the point_conversion_form. See _E_C___G_R_O_U_P___c_o_p_y(3) for a description of point_conversion_form. When reading a private key encoded without an associated public key (e.g. if EC_PKEY_NO_PUBKEY has been used - see below), then d2i_ECPri- vateKey generates the missing public key automatically. Private keys encoded without parameters (e.g. if EC_PKEY_NO_PARAMETERS has been used - see below) cannot be loaded using d2i_ECPrivateKey. The functions EC_KEY_get_enc_flags and EC_KEY_set_enc_flags get and set the value of the encoding flags for the kkeeyy. There are two encoding flags currently defined - EC_PKEY_NO_PARAMETERS and EC_PKEY_NO_PUBKEY. These flags define the behaviour of how the kkeeyy is converted into ASN1 in a call to i2d_ECPrivateKey. If EC_PKEY_NO_PARAMETERS is set then the public parameters for the curve are not encoded along with the private key. If EC_PKEY_NO_PUBKEY is set then the public key is not encoded along with the private key. RREETTUURRNN VVAALLUUEESS _d_2_i___E_C_P_r_i_v_a_t_e_K_e_y_(_) returns a valid EECC__KKEEYY structure or NNUULLLL if an error occurs. The error code that can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3). _i_2_d___E_C_P_r_i_v_a_t_e_K_e_y_(_) returns the number of bytes successfully encoded or a negative value if an error occurs. The error code can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3). EC_KEY_get_enc_flags returns the value of the current encoding flags for the EC_KEY. SSEEEE AALLSSOO _c_r_y_p_t_o(3), _e_c(3), _E_C___G_R_O_U_P___n_e_w(3), _E_C___G_R_O_U_P___c_o_p_y(3), _E_C___P_O_I_N_T___n_e_w(3), _E_C___P_O_I_N_T___a_d_d(3), _E_C___G_F_p___s_i_m_p_l_e___m_e_t_h_o_d(3), _d_2_i___E_C_P_K_P_a_r_a_m_e_t_e_r_s(3), _d_2_i___E_C_P_r_i_v_a_t_e_K_e_y(3) 1.0.1u 2016-09-22 d2i_ECPrivateKey(3)