pub enum JWTPrivateKey {
ES256 {
priv: String,
},
ES384 {
priv: String,
},
}Variants§
Implementations§
Source§impl JWTPrivateKey
impl JWTPrivateKey
Sourcepub fn parse_key_pem(key: &str) -> Res<Self>
pub fn parse_key_pem(key: &str) -> Res<Self>
Parse private key from given PEM
Sourcepub fn generate_ec256_signing_key() -> Res<Self>
pub fn generate_ec256_signing_key() -> Res<Self>
Generate a new elliptic curve 256 signing key
Sourcepub fn generate_ec384_signing_key() -> Res<Self>
pub fn generate_ec384_signing_key() -> Res<Self>
Generate a new ES384 signing key
Sourcepub fn to_public_key(&self) -> Res<JWTPublicKey>
pub fn to_public_key(&self) -> Res<JWTPublicKey>
Get associated public key
Sourcepub fn get_encoding_key(&self) -> Res<(Zeroizing<EncodingKey>, Algorithm)>
pub fn get_encoding_key(&self) -> Res<(Zeroizing<EncodingKey>, Algorithm)>
Get the decoding key & algorithm associated with a private key
Trait Implementations§
Source§impl Clone for JWTPrivateKey
impl Clone for JWTPrivateKey
Source§fn clone(&self) -> JWTPrivateKey
fn clone(&self) -> JWTPrivateKey
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 JWTPrivateKey
impl Debug for JWTPrivateKey
Source§impl<'de> Deserialize<'de> for JWTPrivateKey
impl<'de> Deserialize<'de> for JWTPrivateKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Drop for JWTPrivateKey
impl Drop for JWTPrivateKey
Source§impl Serialize for JWTPrivateKey
impl Serialize for JWTPrivateKey
Auto Trait Implementations§
impl Freeze for JWTPrivateKey
impl RefUnwindSafe for JWTPrivateKey
impl Send for JWTPrivateKey
impl Sync for JWTPrivateKey
impl Unpin for JWTPrivateKey
impl UnsafeUnpin for JWTPrivateKey
impl UnwindSafe for JWTPrivateKey
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