The EVP signature routines are a high level interface to digital signatures.
EVP_SignInit_ex() sets up signing context ctx to use digest type from ENGINE impl. ctx must be initialized with EVP_MD_CTX_init() before calling this function.
EVP_SignUpdate() hashes cnt bytes of data at d into the signature context ctx. This function can be called several times on the same ctx to include additional data.
EVP_SignFinal() signs the data in ctx using the private key pkey and places the signature in sig. The number of bytes of data written (i.e. the length of the signature) will be written to the integer at s, at most EVP_PKEY_size(pkey) bytes will be written.
EVP_SignInit() initializes a signing context ctx to use the default implementation of digest type.
EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual signature returned by EVP_SignFinal() may be smaller.