Hi pbreed,
We do not directly support generating a JSON web key, but we do support generating keys, exporting their components and encoding them as base64. After following these steps, you will need to handle creating the JSON and adding the base64-encoded components to this JSON.
For RSA:
1) Generate an RSA key using wc_MakeRsaKey: https://www.wolfssl.com/documentation/m … makersakey
2) Export the RSA key using wc_RsaFlattenPublicKey (n/e only for public key) or wc_RsaExportKey (all components for public + private key): https://www.wolfssl.com/documentation/m … npublickey
For ECC:
1) Generate an ECC key using wc_ecc_make_key: https://www.wolfssl.com/documentation/m … c_make_key
2) Export the ECC key using wc_ecc_export_public_raw/wc_ecc_export_private_raw.
Now base64 encode each component using Base64_Encode_NoNl: https://www.wolfssl.com/documentation/m … ncode_nonl
Then you will need to create the appropriate JSON and add these components.
Thanks,
Kareem