mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-28 02:02:51 +01:00
PKCS#8-formatted key. There's already a function wc_CreatePKCS8Key, but this only creates the unencrypted PKCS#8 key. TraditionalEnc exists, which takes a non-PKCS#8 key, converts it to PKCS#8 format, and encrypts it, but this function isn't in the public-facing API. I've modified TraditionalEnc to use wc_EncryptPKCS8Key after wc_CreatePKCS8Key. wc_EncryptPKCS8Key is essentially the encryption portion of TraditionalEnc moved out into its own function. wc_EncryptPKCS8Key will be in the API going forward so that users can do PKCS#8 encryption without relying on the non-API TraditionalEnc. Next, I'll be adding a corresponding wc_DecryptPKCS8Key to handle decryption.