Struct jsonwebtoken::EncodingKey [−][src]
A key to encode a JWT with. Can be a secret, a PEM-encoded key or a DER-encoded key. This key can be re-used so make sure you only initialize it once if you can for better performance
Implementations
impl EncodingKey
[src]
pub fn from_secret(secret: &[u8]) -> Self
[src]
If you’re using a HMAC secret that is not base64, use that.
pub fn from_base64_secret(secret: &str) -> Result<Self>
[src]
If you have a base64 HMAC secret, use that.
pub fn from_rsa_pem(key: &[u8]) -> Result<Self>
[src]
If you are loading a RSA key from a .pem file. This errors if the key is not a valid RSA key.
pub fn from_ec_pem(key: &[u8]) -> Result<Self>
[src]
If you are loading a ECDSA key from a .pem file This errors if the key is not a valid private EC key
pub fn from_ed_pem(key: &[u8]) -> Result<Self>
[src]
If you are loading a EdDSA key from a .pem file This errors if the key is not a valid private Ed key
pub fn from_rsa_der(der: &[u8]) -> Self
[src]
If you know what you’re doing and have the DER-encoded key, for RSA only
pub fn from_ec_der(der: &[u8]) -> Self
[src]
If you know what you’re doing and have the DER-encoded key, for ECDSA
pub fn from_ed_der(der: &[u8]) -> Self
[src]
If you know what you’re doing and have the DER-encoded key, for EdDSA
Trait Implementations
impl Clone for EncodingKey
[src]
fn clone(&self) -> EncodingKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EncodingKey
[src]
impl PartialEq<EncodingKey> for EncodingKey
[src]
fn eq(&self, other: &EncodingKey) -> bool
[src]
fn ne(&self, other: &EncodingKey) -> bool
[src]
impl StructuralPartialEq for EncodingKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for EncodingKey
impl Send for EncodingKey
impl Sync for EncodingKey
impl Unpin for EncodingKey
impl UnwindSafe for EncodingKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,