Skip to content

Commit 1bc73dc

Browse files
stevefan1999-personaldjc
authored andcommitted
add ed448 support
1 parent 1471268 commit 1bc73dc

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/alg_id.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,17 @@ pub const RSA_PSS_SHA512: AlgorithmIdentifier =
307307
pub const ED25519: AlgorithmIdentifier =
308308
AlgorithmIdentifier::from_slice(include_bytes!("data/alg-ed25519.der"));
309309

310+
/// AlgorithmIdentifier for `ED448`.
311+
///
312+
/// This is:
313+
///
314+
/// ```text
315+
/// # ed448
316+
/// OBJECT_IDENTIFIER { 1.3.101.113 }
317+
/// ```
318+
pub const ED448: AlgorithmIdentifier =
319+
AlgorithmIdentifier::from_slice(include_bytes!("data/alg-ed448.der"));
320+
310321
/// A DER encoding of the PKIX AlgorithmIdentifier type:
311322
///
312323
/// ```ASN.1

src/data/alg-ed448.der

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
+eq

tests/key_type.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ fn test_private_key_from_der() {
2424
const RSA_2048_KEY_PKCS8: &[u8] = include_bytes!("../tests/keys/rsa2048key.pkcs8.der");
2525
const RSA_4096_KEY: &[u8] = include_bytes!("../tests/keys/rsa4096key.pkcs8.der");
2626
const ED25519_KEY: &[u8] = include_bytes!("../tests/keys/edd25519_v2.der");
27+
const ED448_KEY: &[u8] = include_bytes!("../tests/keys/ed448.pkcs8.der");
2728
const PKCS8_KEYS: &[&[u8]] = &[
2829
NIST_P256_KEY_PKCS8,
2930
NIST_P384_KEY_PKCS8,
3031
NIST_P521_KEY_PKCS8,
3132
RSA_2048_KEY_PKCS8,
3233
RSA_4096_KEY,
3334
ED25519_KEY,
35+
ED448_KEY,
3436
];
3537

3638
for &bytes in PKCS8_KEYS {

tests/keys/ed448.pkcs8.der

73 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)