EVP_PKEY_CTX_md

Set a digest algorithm on a key context by name for the given operation.

Synopsis

Declared in <openssl/evp.h>

int
EVP_PKEY_CTX_md(
    EVP_PKEY_CTX* ctx,
    int optype,
    int cmd,
    char const* md);

Return Value

Positive value on success, or a non-positive value on failure.

Parameters

NameDescription
ctxKey context to update.
optypeOperation type such as EVP_PKEY_OP_TYPE_SIG.
cmdControl command that expects an EVP_MD (for example EVP_PKEY_CTRL_MD).
mdDigest name such as "SHA256".