Skip to content

Commit

Permalink
Implement From<&PublicKey> for PublicKeyComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Feb 18, 2025
1 parent 5337f14 commit f290d20
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aws-lc-rs/src/rsa/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<B> TryInto<PublicEncryptingKey> for PublicKeyComponents<B>
where
B: AsRef<[u8]> + Debug,
Expand Down

0 comments on commit f290d20

Please sign in to comment.