EVP_PKEY_sign

Create a signature over data using an initialized signing context.

Synopsis

Declared in <openssl/evp.h>

int
EVP_PKEY_sign(
    EVP_PKEY_CTX* ctx,
    unsigned char* sig,
    size_t* siglen,
    unsigned char const* tbs,
    size_t tbslen);

Return Value

1 on success, 0 or a negative value on failure.

Parameters

NameDescription
ctxContext previously prepared with EVP_PKEY_sign_init() (and optional controls).
sigOutput buffer for the signature, or NULL to only query the required length.
siglenOn entry, capacity of sig when non-NULL; on return, signature length in bytes.
tbsMessage or digest bytes to sign.
tbslenLength of tbs in bytes.