pem_password_cb

Callback that supplies a passphrase when reading or writing encrypted PEM.

Synopsis

Declared in <openssl/types.h>

typedef int pem_password_cb(char*, int, int, void*);

Return Value

Number of password bytes written to buf (excluding NUL), or 0 on failure.

Parameters

NameDescription
bufOutput buffer that receives a NUL-terminated password.
sizeCapacity of buf in bytes.
rwflag0 when reading (decrypt), nonzero when writing (encrypt).
userdataApplication pointer from the PEM API that invoked the callback.