pub struct RsaPublicKey { /* private fields */ }Expand description
The verifying half of an RSA key pair.
Implementations§
Source§impl RsaPublicKey
impl RsaPublicKey
Sourcepub fn from_spki_der(der: &[u8]) -> Result<Self, Error>
pub fn from_spki_der(der: &[u8]) -> Result<Self, Error>
Wraps a raw SubjectPublicKeyInfo DER blob.
§Errors
Returns Error::InvalidPkcs8 if the DER is truncated.
Sourcepub fn as_spki_der(&self) -> &[u8] ⓘ
pub fn as_spki_der(&self) -> &[u8] ⓘ
Returns the SubjectPublicKeyInfo DER representation.
Sourcepub fn verify(
&self,
message: &[u8],
signature_bytes: &[u8],
) -> Result<(), Error>
pub fn verify( &self, message: &[u8], signature_bytes: &[u8], ) -> Result<(), Error>
Verifies an RSA PKCS#1 v1.5 SHA-256 signature of message.
Accepts signatures created by any SHA-256-based PKCS#1 v1.5 RSA key
in the 2048–8192 bit range, matching what aws-lc-rs considers
interoperable.
§Errors
Returns Error::VerificationFailed if the signature is invalid
or the key is malformed.
Trait Implementations§
Source§impl Clone for RsaPublicKey
impl Clone for RsaPublicKey
Source§fn clone(&self) -> RsaPublicKey
fn clone(&self) -> RsaPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RsaPublicKey
impl Debug for RsaPublicKey
impl Eq for RsaPublicKey
Source§impl PartialEq for RsaPublicKey
impl PartialEq for RsaPublicKey
Auto Trait Implementations§
impl Freeze for RsaPublicKey
impl RefUnwindSafe for RsaPublicKey
impl Send for RsaPublicKey
impl Sync for RsaPublicKey
impl Unpin for RsaPublicKey
impl UnsafeUnpin for RsaPublicKey
impl UnwindSafe for RsaPublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.