PEM_def_callback

Default pem_password_cb that prompts on the terminal (or copies userdata).

Synopsis

Declared in <openssl/pem.h>

int
PEM_def_callback(
    char* buf,
    int num,
    int rwflag,
    void* userdata);

Return Value

Password length written to buf, or 0 on failure / empty input.

Parameters

NameDescription
bufDestination buffer for the password bytes.
numCapacity of buf in bytes.
rwflag0 when reading/decrypting, non-zero when writing/encrypting.
userdataOptional default password string, or NULL to prompt.