From f290d203743950caf28ed9d0037c56b363ac0cf7 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 18 Feb 2025 11:47:20 +0100 Subject: [PATCH] Implement From<&PublicKey> for PublicKeyComponents --- aws-lc-rs/src/rsa/key.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws-lc-rs/src/rsa/key.rs b/aws-lc-rs/src/rsa/key.rs index de3fcae7a3d..5d7dca53bf1 100644 --- a/aws-lc-rs/src/rsa/key.rs +++ b/aws-lc-rs/src/rsa/key.rs @@ -430,6 +430,15 @@ where } } +impl From<&PublicKey> for PublicKeyComponents<&[u8]> { + fn from(public_key: &PublicKey) -> Self { + PublicKeyComponents { + n: public_key.modulus.as_ref(), + e: public_key.exponent.as_ref(), + } + } +} + impl TryInto for PublicKeyComponents where B: AsRef<[u8]> + Debug,