pub struct RsaPublicKey { /* private fields */ }Available on crate features
auth-asymmetric or sso only.Expand description
An RSA public key, ready to verify signatures.
Implementations§
Source§impl RsaPublicKey
impl RsaPublicKey
Sourcepub fn from_components(n: &[u8], e: &[u8]) -> Result<RsaPublicKey, String>
pub fn from_components(n: &[u8], e: &[u8]) -> Result<RsaPublicKey, String>
From the big-endian modulus n and public exponent e — e.g. a JWK’s
base64url-decoded n and e.
Sourcepub fn from_pkcs1_der(der: &[u8]) -> Result<RsaPublicKey, String>
pub fn from_pkcs1_der(der: &[u8]) -> Result<RsaPublicKey, String>
From a PKCS#1 RSAPublicKey (SEQUENCE { n INTEGER, e INTEGER }), DER.
Sourcepub fn from_public_key_der(spki: &[u8]) -> Result<RsaPublicKey, String>
pub fn from_public_key_der(spki: &[u8]) -> Result<RsaPublicKey, String>
From an X.509 SubjectPublicKeyInfo (the BEGIN PUBLIC KEY form, and
what a certificate carries), DER. Must be an rsaEncryption key.
Sourcepub fn from_public_key_pem(pem: &str) -> Result<RsaPublicKey, String>
pub fn from_public_key_pem(pem: &str) -> Result<RsaPublicKey, String>
From PEM: -----BEGIN PUBLIC KEY----- (SubjectPublicKeyInfo) or
-----BEGIN RSA PUBLIC KEY----- (PKCS#1).
Sourcepub fn verify_pkcs1v15_sha256(&self, message: &[u8], signature: &[u8]) -> bool
pub fn verify_pkcs1v15_sha256(&self, message: &[u8], signature: &[u8]) -> bool
true if signature is a valid RSASSA-PKCS1-v1_5 signature with
SHA-256 (JWS RS256, XML-DSig rsa-sha256) of message.
Sourcepub fn verify_pkcs1v15_sha256_prehashed(
&self,
hash: &[u8],
signature: &[u8],
) -> bool
pub fn verify_pkcs1v15_sha256_prehashed( &self, hash: &[u8], signature: &[u8], ) -> bool
As verify_pkcs1v15_sha256, given the
SHA-256 hash of the message.
Trait Implementations§
Source§impl Clone for RsaPublicKey
impl Clone for RsaPublicKey
Source§fn clone(&self) -> RsaPublicKey
fn clone(&self) -> RsaPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RsaPublicKey
impl Debug for RsaPublicKey
impl Eq for RsaPublicKey
Auto Trait Implementations§
impl Freeze for RsaPublicKey
impl RefUnwindSafe for RsaPublicKey
impl Send for RsaPublicKey
impl Sync for RsaPublicKey
impl Unpin for RsaPublicKey
impl UnsafeUnpin for RsaPublicKey
impl UnwindSafe for RsaPublicKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more