pub struct JsonWebKey {
pub kid: String,
pub usage: String,
pub alg: Algorithm,
pub crv: Option<Curve>,
pub kty: KeyType,
}Expand description
A JSON web key used to verify signatures.
Fields§
§kid: StringThe ID of this key.
usage: StringThe use for this key. http://www.iana.org/assignments/jose/jose.xhtml#web-key-use
alg: AlgorithmThe algorithm for this key
crv: Option<Curve>This key’s curve
kty: KeyTypeThe parameters that make up the public key.
Implementations§
Source§impl JsonWebKey
impl JsonWebKey
Sourcepub fn verifies_signature(&self, jwt: &JsonWebToken) -> bool
pub fn verifies_signature(&self, jwt: &JsonWebToken) -> bool
Returns if the signature on a JSON web token is valid according to this key.
Sourcepub fn from_key(key: &VerifyingKey) -> Option<Self>
pub fn from_key(key: &VerifyingKey) -> Option<Self>
Create a JSON web key from a key.
Trait Implementations§
Source§impl Clone for JsonWebKey
impl Clone for JsonWebKey
Source§fn clone(&self) -> JsonWebKey
fn clone(&self) -> JsonWebKey
Returns a duplicate of the value. Read more
1.0.0 · 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 JsonWebKey
impl Debug for JsonWebKey
Source§impl<'de> Deserialize<'de> for JsonWebKey
impl<'de> Deserialize<'de> for JsonWebKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for JsonWebKey
impl PartialEq for JsonWebKey
Source§impl Serialize for JsonWebKey
impl Serialize for JsonWebKey
impl StructuralPartialEq for JsonWebKey
Auto Trait Implementations§
impl Freeze for JsonWebKey
impl RefUnwindSafe for JsonWebKey
impl Send for JsonWebKey
impl Sync for JsonWebKey
impl Unpin for JsonWebKey
impl UnwindSafe for JsonWebKey
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