PublicKey

Trait PublicKey 

Source
pub trait PublicKey: ErasedSerialize {
    // Required methods
    fn key_id(&self) -> &str;
    fn algorithm(&self) -> &str;
    fn key_use(&self) -> KeyUse;
    fn verify(&self, message: &[u8], signature: &[u8]) -> bool;
}
Expand description

A public key. The ErasedSerialize implementation must serialize to a JWK.

Required Methods§

Source

fn key_id(&self) -> &str

Key ID.

Source

fn algorithm(&self) -> &str

Algorithm.

Source

fn key_use(&self) -> KeyUse

Intended use for the key.

Source

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

Verify the signature of the message.

Trait Implementations§

Source§

impl<'erased> Serialize for dyn PublicKey + 'erased

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'erased> Serialize for dyn PublicKey + Send + 'erased

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'erased> Serialize for dyn PublicKey + Send + Sync + 'erased

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'erased> Serialize for dyn PublicKey + Sync + 'erased

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§