pem.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*!
  2. \ingroup openSSL
  3. \brief This function writes a key into a WOLFSSL_BIO structure
  4. in PEM format.
  5. \return SSL_SUCCESS upon success.
  6. \return SSL_FAILURE upon failure.
  7. \param bio WOLFSSL_BIO structure to get PEM buffer from.
  8. \param key key to convert to PEM format.
  9. \param cipher EVP cipher structure.
  10. \param passwd password.
  11. \param len length of password.
  12. \param cb password callback.
  13. \param arg optional argument.
  14. _Example_
  15. \code
  16. WOLFSSL_BIO* bio;
  17. WOLFSSL_EVP_PKEY* key;
  18. int ret;
  19. // create bio and setup key
  20. ret = wolfSSL_PEM_write_bio_PrivateKey(bio, key, NULL, NULL, 0, NULL, NULL);
  21. //check ret value
  22. \endcode
  23. \sa wolfSSL_PEM_read_bio_X509_AUX
  24. */
  25. int wolfSSL_PEM_write_bio_PrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY* key,
  26. const WOLFSSL_EVP_CIPHER* cipher,
  27. unsigned char* passwd, int len,
  28. wc_pem_password_cb* cb, void* arg);