pub struct PrivateKey { /* private fields */ }Expand description
A private key with key-signing capabilities.
Implementations§
Source§impl PrivateKey
impl PrivateKey
pub fn key_type(&self) -> KeyType
pub fn set_kid(&mut self, kid: Option<String>)
pub fn from_bare_private_key( kid: Option<String>, key: BarePrivateKey, ) -> Result<Self, KeyError>
pub fn clone_key(&self) -> Self
pub fn sign( &self, claims: HashMap<String, Any>, ctx: &SigningContext, ) -> Result<String, SignatureError>
pub fn validate( &self, token: &str, ctx: &ValidationContext, ) -> Result<HashMap<String, Any>, ValidationError>
Trait Implementations§
Source§impl From<PrivateKey> for Key
impl From<PrivateKey> for Key
Source§fn from(key: PrivateKey) -> Self
fn from(key: PrivateKey) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
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