From 33694de72d8a1c5714bea76ed70c755b5bb64a3e Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 3 Apr 2017 01:41:35 -0400 Subject: PKCS #8 code for RSA and ECDSA. Compiles, not yet tested. Existing tests need conversion to PKCS #8 before we can do anything useful with this. Once everything uses PKCS #8 instead of algorithm-specific formats, we can revisit API issues like whether hal_rpc_pkey_load() should still be taking `type` and `curve` arguments. --- asn1_internal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'asn1_internal.h') diff --git a/asn1_internal.h b/asn1_internal.h index 01ffc22..c337d4b 100644 --- a/asn1_internal.h +++ b/asn1_internal.h @@ -89,6 +89,20 @@ static inline uint8_t *unconst_uint8_t(const uint8_t * const arg) return (uint8_t *) arg; } +/* + * OIDs. + */ + +extern const uint8_t hal_asn1_oid_rsaEncryption[]; +extern const size_t hal_asn1_oid_rsaEncryption_len; + +extern const uint8_t hal_asn1_oid_ecPublicKey[]; +extern const size_t hal_asn1_oid_ecPublicKey_len; + +/* + * Transcoding functions. + */ + extern hal_error_t hal_asn1_encode_header(const uint8_t tag, const size_t value_len, uint8_t *der, size_t *der_len, const size_t der_max); -- cgit v1.2.3