Write a private key to a BIO using the legacy "traditional" PEM private-key format.
Declared in <openssl/pem.h>
int
PEM_write_bio_PrivateKey_traditional(
BIO* bp,
EVP_PKEY const* x,
EVP_CIPHER const* enc,
unsigned char const* kstr,
int klen,
pem_password_cb* cb,
void* u);
Prefer PEM_write_bio_PrivateKey() / PKCS#8 for new keys; this exists for legacy compatibility.
1 on success, or 0 on failure.
| Name | Description |
|---|---|
| bp | BIO to write to. |
| x | Private key to encode. |
| enc | Optional cipher for traditional PEM encryption, or NULL for cleartext. |
| kstr | Optional passphrase bytes; if NULL and enc is set, cb is used. |
| klen | Length of kstr when provided. |
| cb | Password callback when a passphrase is needed, or NULL. |
| u | Application data passed to cb. |