Struct jwtk::rsa::RsaPublicKey
source · [−]pub struct RsaPublicKey {
pub algorithm: Option<RsaAlgorithm>,
/* private fields */
}
Expand description
RSA Public Key.
Fields
algorithm: Option<RsaAlgorithm>
If this is None
, this key verifies signatures generated by ANY RSA
algorithms. Otherwise it ONLY verifies signatures generated by this
algorithm.
Implementations
sourceimpl RsaPublicKey
impl RsaPublicKey
sourcepub fn from_pem(pem: &[u8], algorithm: Option<RsaAlgorithm>) -> Result<Self>
pub fn from_pem(pem: &[u8], algorithm: Option<RsaAlgorithm>) -> Result<Self>
Both BEGIN PUBLIC KEY
and BEGIN RSA PUBLIC KEY
are OK.
pub fn from_components(
n: &[u8],
e: &[u8],
algorithm: Option<RsaAlgorithm>
) -> Result<Self>
sourcepub fn to_pem_pkcs1(&self) -> Result<String>
pub fn to_pem_pkcs1(&self) -> Result<String>
BEGIN RSA PUBLIC KEY
pub fn n(&self) -> Result<Vec<u8>>
pub fn e(&self) -> Result<Vec<u8>>
Trait Implementations
sourceimpl Debug for RsaPublicKey
impl Debug for RsaPublicKey
sourceimpl From<RsaPublicKey> for SomePublicKey
impl From<RsaPublicKey> for SomePublicKey
sourcefn from(k: RsaPublicKey) -> SomePublicKey
fn from(k: RsaPublicKey) -> SomePublicKey
Converts to this type from the input type.
sourceimpl PublicKeyToJwk for RsaPublicKey
impl PublicKeyToJwk for RsaPublicKey
fn public_key_to_jwk(&self) -> Result<Jwk>
Auto Trait Implementations
impl RefUnwindSafe for RsaPublicKey
impl Send for RsaPublicKey
impl Sync for RsaPublicKey
impl Unpin for RsaPublicKey
impl UnwindSafe for RsaPublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more