pub trait VerifyingKey {
// Required methods
fn modulus(&self) -> Vec<u8> ⓘ;
fn exponent(&self) -> Vec<u8> ⓘ;
fn from_parameters(modulus: &[u8], exponent: &[u8]) -> Option<Self>
where Self: Sized;
fn from_pkcs1_der(der: &[u8]) -> Option<Self>
where Self: Sized;
fn from_spki_der(der: &[u8]) -> Option<Self>
where Self: Sized;
fn verifies_rs256(&self, signature: &[u8], message: &[u8]) -> bool;
fn verifies_ps256(&self, signature: &[u8], message: &[u8]) -> bool;
fn verifies_rs384(&self, signature: &[u8], message: &[u8]) -> bool;
fn verifies_ps384(&self, signature: &[u8], message: &[u8]) -> bool;
fn verifies_rs512(&self, signature: &[u8], message: &[u8]) -> bool;
fn verifies_ps512(&self, signature: &[u8], message: &[u8]) -> bool;
}Expand description
A verifying key using RSA.
Required Methods§
Sourcefn from_parameters(modulus: &[u8], exponent: &[u8]) -> Option<Self>where
Self: Sized,
fn from_parameters(modulus: &[u8], exponent: &[u8]) -> Option<Self>where
Self: Sized,
Create a new key from its parameters.
Sourcefn from_pkcs1_der(der: &[u8]) -> Option<Self>where
Self: Sized,
fn from_pkcs1_der(der: &[u8]) -> Option<Self>where
Self: Sized,
Create a new key from a PKCS1 der.
Sourcefn from_spki_der(der: &[u8]) -> Option<Self>where
Self: Sized,
fn from_spki_der(der: &[u8]) -> Option<Self>where
Self: Sized,
Create a new key from a subject public key info der.
Sourcefn verifies_rs256(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies_rs256(&self, signature: &[u8], message: &[u8]) -> bool
Returns if this key verifies the signature to match the message using the RS256 parameters.
Sourcefn verifies_ps256(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies_ps256(&self, signature: &[u8], message: &[u8]) -> bool
Returns if this key verifies the signature to match the message using the PS256 parameters.
Sourcefn verifies_rs384(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies_rs384(&self, signature: &[u8], message: &[u8]) -> bool
Returns if this key verifies the signature to match the message using the RS384 parameters.
Sourcefn verifies_ps384(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies_ps384(&self, signature: &[u8], message: &[u8]) -> bool
Returns if this key verifies the signature to match the message using the PS384 parameters.
Sourcefn verifies_rs512(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies_rs512(&self, signature: &[u8], message: &[u8]) -> bool
Returns if this key verifies the signature to match the message using the RS512 parameters.
Sourcefn verifies_ps512(&self, signature: &[u8], message: &[u8]) -> bool
fn verifies_ps512(&self, signature: &[u8], message: &[u8]) -> bool
Returns if this key verifies the signature to match the message using the PS512 parameters.