Skip to main content

RS256PublicKey

Struct RS256PublicKey 

Source
pub struct RS256PublicKey { /* private fields */ }

Implementations§

Source§

impl RS256PublicKey

Source

pub fn from_der(der: &[u8]) -> Result<Self, Error>

Source

pub fn from_pem(pem: &str) -> Result<Self, Error>

Source

pub fn from_components(n: &[u8], e: &[u8]) -> Result<Self, Error>

Source

pub fn to_der(&self) -> Result<Vec<u8>, Error>

Source

pub fn to_pem(&self) -> Result<String, Error>

Source

pub fn to_components(&self) -> RSAPublicKeyComponents

Source

pub fn with_key_id(self, key_id: &str) -> Self

Source

pub fn from_jwk(jwk: &str) -> Result<Self, Error>

Import a public key from an RSA JWK.

The modulus must be 2048 to 4096 bits long, and the exponent 65537. See strict JWK validation for the other rules.

Source

pub fn to_jwk(&self) -> String

Export the public key as a JWK, with alg: RS256 and use: sig.

Source

pub fn jwk_thumbprint(&self) -> String

The JWK thumbprint of the key.

Source

pub fn sha1_thumbprint(&self) -> String

Source

pub fn sha256_thumbprint(&self) -> String

Trait Implementations§

Source§

impl Clone for RS256PublicKey

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RS256PublicKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RSAPublicKeyLike for RS256PublicKey

Source§

fn jwt_alg_name() -> &'static str

Source§

fn hash() -> MessageDigest

Source§

fn padding_scheme(&self) -> Padding

Source§

fn public_key(&self) -> &RSAPublicKey

Source§

fn key_id(&self) -> &Option<String>

Source§

fn set_key_id(&mut self, key_id: String)

Source§

fn verify_token<CustomClaims: DeserializeOwned>( &self, token: &str, options: Option<VerificationOptions>, ) -> Result<JWTClaims<CustomClaims>, Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V