diff options
author | Rob Austein <sra@hactrn.net> | 2017-04-03 01:41:35 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2017-04-03 01:41:35 -0400 |
commit | 33694de72d8a1c5714bea76ed70c755b5bb64a3e (patch) | |
tree | 0861e495196b7eff194eabd8c4b4c5401fdcc274 /asn1_internal.h | |
parent | e36bfa86709e0823c2b1635afbac0bf68cb6c1cd (diff) |
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.
Diffstat (limited to 'asn1_internal.h')
-rw-r--r-- | asn1_internal.h | 14 |
1 files changed, 14 insertions, 0 deletions
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); |