Skip to content

pem.h

Functions

Name
int wolfSSL_PEM_write_bio_PrivateKey(WOLFSSL_BIO * bio, WOLFSSL_EVP_PKEY * key, const WOLFSSL_EVP_CIPHER * cipher, unsigned char * passwd, int len, wc_pem_password_cb * cb, void * arg)
This function writes a key into a WOLFSSL_BIO structure in PEM format.

Functions Documentation

function wolfSSL_PEM_write_bio_PrivateKey

int wolfSSL_PEM_write_bio_PrivateKey(
    WOLFSSL_BIO * bio,
    WOLFSSL_EVP_PKEY * key,
    const WOLFSSL_EVP_CIPHER * cipher,
    unsigned char * passwd,
    int len,
    wc_pem_password_cb * cb,
    void * arg
)

This function writes a key into a WOLFSSL_BIO structure in PEM format.

Parameters:

  • bio WOLFSSL_BIO structure to get PEM buffer from.
  • key key to convert to PEM format.
  • cipher EVP cipher structure.
  • passwd password.
  • len length of password.
  • cb password callback.
  • arg optional argument.

See: wolfSSL_PEM_read_bio_X509_AUX

Return:

  • SSL_SUCCESS upon success.
  • SSL_FAILURE upon failure.

Example

WOLFSSL_BIO* bio;
WOLFSSL_EVP_PKEY* key;
int ret;
// create bio and setup key
ret = wolfSSL_PEM_write_bio_PrivateKey(bio, key, NULL, NULL, 0, NULL, NULL);
//check ret value

Source code


int wolfSSL_PEM_write_bio_PrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY* key,
                                        const WOLFSSL_EVP_CIPHER* cipher,
                                        unsigned char* passwd, int len,
                                        wc_pem_password_cb* cb, void* arg);

Updated on 2024-12-20 at 01:22:24 +0000