PK: add mbedtls_pk_write_pubkey_psa() #529

Closed
opened 2025-10-17 03:10:05 -05:00 by mpg · 0 comments
mpg commented 2025-10-17 03:10:05 -05:00 (Migrated from github.com)

Add a new public function mbedtls_pk_write_pubkey_psa() that writes out a public key in the format used by PSA.

This is very similar to the existing internal function mbedtls_pk_write_pubkey() except:

  • it should be public;
  • unlike the internal function it should have a "normal" API like unsigned char *buf, size_t buf_size, size_t *buf_len and write to the beginning of the output buffer;
  • the documentation should say how to determine a sufficient size of the output buffer, ideally both a generic maximum with a macro with no argument, and a more precise version depending on the key type and bitsize with PSA's function-like macros;
  • the tests should use buffer sized as documented to ensure it works :)
Add a new public function `mbedtls_pk_write_pubkey_psa()` that writes out a public key in the format used by PSA. This is very similar to the existing internal function `mbedtls_pk_write_pubkey()` except: - it should be public; - unlike the internal function it should have a "normal" API like `unsigned char *buf, size_t buf_size, size_t *buf_len` and write to the beginning of the output buffer; - the documentation should say how to determine a sufficient size of the output buffer, ideally both a generic maximum with a macro with no argument, and a more precise version depending on the key type and bitsize with PSA's function-like macros; - the tests should use buffer sized as documented to ensure it works :)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/TF-PSA-Crypto#529
No description provided.