Damn, I was lazy again. I merely had to recognize that this was an EC key, parse the PEM file content, and extract the key bytes. It works. But it still would be very nice if there was a code sample, or better yet a version "psa_import key" that works just like mbedtls_pk_parse_keyfile().
On 11/17/2023 6:14 PM, Christian Huitema via mbed-tls wrote:
I am trying to use psa_import_key() after loading private keys from PEM files. I am succeeding when parsing an "RSA PRIVATE KEY", but no such luck for "EC PRIVATE KEY". I assume that I am not setting attributes correctly. A code sample would be nice!
Or, maybe I could just use mbedtls_pk_parse_keyfile(), but then I would need to "import" a PSA key from the "mbedtls" context, ad I did not find sample code for that either.
-- Christian Huitema