VerifyingKey

Trait VerifyingKey 

Source
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§

Source

fn modulus(&self) -> Vec<u8>

Get the key’s modulus.

Source

fn exponent(&self) -> Vec<u8>

Get the key’s exponent.

Source

fn from_parameters(modulus: &[u8], exponent: &[u8]) -> Option<Self>
where Self: Sized,

Create a new key from its parameters.

Source

fn from_pkcs1_der(der: &[u8]) -> Option<Self>
where Self: Sized,

Create a new key from a PKCS1 der.

Source

fn from_spki_der(der: &[u8]) -> Option<Self>
where Self: Sized,

Create a new key from a subject public key info der.

Source

fn verifies_rs256(&self, signature: &[u8], message: &[u8]) -> bool

Returns if this key verifies the signature to match the message using the RS256 parameters.

Source

fn verifies_ps256(&self, signature: &[u8], message: &[u8]) -> bool

Returns if this key verifies the signature to match the message using the PS256 parameters.

Source

fn verifies_rs384(&self, signature: &[u8], message: &[u8]) -> bool

Returns if this key verifies the signature to match the message using the RS384 parameters.

Source

fn verifies_ps384(&self, signature: &[u8], message: &[u8]) -> bool

Returns if this key verifies the signature to match the message using the PS384 parameters.

Source

fn verifies_rs512(&self, signature: &[u8], message: &[u8]) -> bool

Returns if this key verifies the signature to match the message using the RS512 parameters.

Source

fn verifies_ps512(&self, signature: &[u8], message: &[u8]) -> bool

Returns if this key verifies the signature to match the message using the PS512 parameters.

Implementors§