Open mvgalen opened 6 years ago
I'll second this request! I just had to learn enough ASN1 to extract the public and private from the SEC1 output of mbedtls_pk_write_key_der() and re-write it as PKCS8 (in Swift.. so not a lot of prior art). My brain is still hurting.
I just put my implementation in a pull request: https://github.com/ARMmbed/mbedtls/pull/1759 The pull request is against development, but it should also apply to 2.8.0, which I used for development/testing.
PR fixing this issue was opened in #1759 , superseded by https://github.com/ARMmbed/mbedtls/pull/2413
Enhancement
Currently mbedtls can not write private keys in PKCS8 format, although it is able to parse PKCS8 format.
Adding support for PKCS8 PEM/DER writing should be relatively simple since it is only an added envelope.