Struct jwtk::rsa::RsaPrivateKey
source · [−]pub struct RsaPrivateKey {
pub algorithm: RsaAlgorithm,
pub verify_any: bool,
/* private fields */
}
Expand description
RSA Private Key.
By default, it only verifies signatures generated by the same algorithm used
for signing. If you want to verify signatures generated by any RSA
algorithm, set verify_any
to true
.
Fields
algorithm: RsaAlgorithm
verify_any: bool
Implementations
sourceimpl RsaPrivateKey
impl RsaPrivateKey
sourcepub fn generate(bits: u32, algorithm: RsaAlgorithm) -> Result<Self>
pub fn generate(bits: u32, algorithm: RsaAlgorithm) -> Result<Self>
bits >= 2048.
pub fn from_pem(pem: &[u8], algorithm: RsaAlgorithm) -> Result<Self>
pub fn private_key_to_pem_pkcs8(&self) -> Result<String>
pub fn public_key_to_pem(&self) -> Result<String>
pub fn public_key_to_pem_pkcs1(&self) -> Result<String>
pub fn n(&self) -> Result<Vec<u8>>
pub fn e(&self) -> Result<Vec<u8>>
Trait Implementations
sourceimpl Clone for RsaPrivateKey
impl Clone for RsaPrivateKey
sourcefn clone(&self) -> RsaPrivateKey
fn clone(&self) -> RsaPrivateKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RsaPrivateKey
impl Debug for RsaPrivateKey
sourceimpl From<RsaPrivateKey> for SomePrivateKey
impl From<RsaPrivateKey> for SomePrivateKey
sourcefn from(k: RsaPrivateKey) -> SomePrivateKey
fn from(k: RsaPrivateKey) -> SomePrivateKey
Converts to this type from the input type.
sourceimpl PrivateKeyToJwk for RsaPrivateKey
impl PrivateKeyToJwk for RsaPrivateKey
fn private_key_to_jwk(&self) -> Result<Jwk>
sourceimpl PublicKeyToJwk for RsaPrivateKey
impl PublicKeyToJwk for RsaPrivateKey
fn public_key_to_jwk(&self) -> Result<Jwk>
sourceimpl SigningKey for RsaPrivateKey
impl SigningKey for RsaPrivateKey
Auto Trait Implementations
impl RefUnwindSafe for RsaPrivateKey
impl Send for RsaPrivateKey
impl Sync for RsaPrivateKey
impl Unpin for RsaPrivateKey
impl UnwindSafe for RsaPrivateKey
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
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more