[#PEM_def_callback]
= PEM&lowbar;def&lowbar;callback
:mrdocs:

Default pem&lowbar;password&lowbar;cb that prompts on the terminal (or copies `userdata)&period;`

== Synopsis

Declared in `&lt;openssl&sol;pem&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
PEM&lowbar;def&lowbar;callback(
    char* buf,
    int num,
    int rwflag,
    void* userdata);
----

== Return Value

Password length written to `buf,` or 0 on failure &sol; empty input&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buf*
| Destination buffer for the password bytes&period;
| *num*
| Capacity of `buf` in bytes&period;
| *rwflag*
| 0 when reading&sol;decrypting, non&hyphen;zero when writing&sol;encrypting&period;
| *userdata*
| Optional default password string, or NULL to prompt&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
