#include
int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *sig,unsigned int *s, EVP_PKEY *pkey);
void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type);
int EVP_PKEY_size(EVP_PKEY *pkey);
_E_V_P___S_i_g_n_I_n_i_t___e_x_(_) sets up signing context ccttxx to use digest ttyyppee from ENGINE iimmppll. ccttxx must be initialized with _E_V_P___M_D___C_T_X___i_n_i_t_(_) before calling this function.
_E_V_P___S_i_g_n_U_p_d_a_t_e_(_) hashes ccnntt bytes of data at dd into the signature context ccttxx. This function can be called several times on the same ccttxx to include additional data.
_E_V_P___S_i_g_n_F_i_n_a_l_(_) signs the data in ccttxx using the private key ppkkeeyy and places the signature in ssiigg. The number of bytes of data written (i.e. the length of the signature) will be written to the integer at ss, at most EVP_PKEY_size(pkey) bytes will be written.
_E_V_P___S_i_g_n_I_n_i_t_(_) initializes a signing context ccttxx to use the default implementation of digest ttyyppee.
_E_V_P___P_K_E_Y___s_i_z_e_(_) returns the maximum size of a signature in bytes. The actual signature returned by _E_V_P___S_i_g_n_F_i_n_a_l_(_) may be smaller.
_E_V_P___P_K_E_Y___s_i_z_e_(_) returns the maximum size of a signature in bytes.
The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3).
Due to the link between message digests and public key algorithms the correct digest algorithm must be used with the correct public key type. A list of algorithms and associated public key algorithms appears in _E_V_P___D_i_g_e_s_t_I_n_i_t(3).
When signing with DSA private keys the random number generator must be seeded or the operation will fail. The random number generator does not need to be seeded for RSA signatures.
The call to _E_V_P___S_i_g_n_F_i_n_a_l_(_) internally finalizes a copy of the digest context. This means that calls to _E_V_P___S_i_g_n_U_p_d_a_t_e_(_) and _E_V_P___S_i_g_n_F_i_n_a_l_(_) can be called later to digest and sign additional data.
Since only a copy of the digest context is ever finalized the context must be cleaned up after use by calling _E_V_P___M_D___C_T_X___c_l_e_a_n_u_p_(_) or a memory leak will occur.
Since the private key is passed in the call to _E_V_P___S_i_g_n_F_i_n_a_l_(_) any error relating to the private key (for example an unsuitable key and digest combination) will not be indicated until after potentially large amounts of data have been passed through _E_V_P___S_i_g_n_U_p_d_a_t_e_(_).
It is not possible to change the signing parameters using these function.
The previous two bugs are fixed in the newer EVP_SignDigest*() function.
_E_V_P___S_i_g_n_I_n_i_t___e_x_(_) was added in OpenSSL 0.9.7.