EVP_PKEY_decrypt

Decrypt data using the private key bound to ctx.

Synopsis

Declared in <openssl/evp.h>

int
EVP_PKEY_decrypt(
    EVP_PKEY_CTX* ctx,
    unsigned char* out,
    size_t* outlen,
    unsigned char const* in,
    size_t inlen);

Return Value

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

Parameters

NameDescription
ctxContext previously initialized with EVP_PKEY_decrypt_init().
outBuffer receiving plaintext, or NULL to query the required size.
outlenIn/out length of out; on return holds bytes written or needed.
inCiphertext bytes to decrypt.
inlenLength of in in bytes.