Skip to content

Commit d3a0c2c

Browse files
committed
psa: Document requirements for psa_export_public_key()
Copy the nice and clear documentation from psa_export_key() as to what implementations are allowed to do regarding key export formats, as the same applies to public keys.
1 parent 83d2939 commit d3a0c2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/psa/crypto.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,13 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
467467
* The output of this function can be passed to psa_import_key() to
468468
* create an object that is equivalent to the public key.
469469
*
470+
* This specification supports a single format for each key type.
471+
* Implementations may support other formats as long as the standard
472+
* format is supported. Implementations that support other formats
473+
* should ensure that the formats are clearly unambiguous so as to
474+
* minimize the risk that an invalid input is accidentally interpreted
475+
* according to a different format.
476+
*
470477
* The format is the DER representation defined by RFC 5280 as
471478
* `SubjectPublicKeyInfo`, with the `subjectPublicKey` format
472479
* specified below.

0 commit comments

Comments
 (0)