pub struct RsaOaepDecryptionKey { /* private fields */ }Expand description
RSA key pair for decryption (RSA-OAEP with SHA-1).
Implementations§
Source§impl RsaOaepDecryptionKey
impl RsaOaepDecryptionKey
Sourcepub fn from_der(der: &[u8]) -> Result<Self, Error>
pub fn from_der(der: &[u8]) -> Result<Self, Error>
Create a decryption key from a DER-encoded private key.
Sourcepub fn from_pem(pem: &str) -> Result<Self, Error>
pub fn from_pem(pem: &str) -> Result<Self, Error>
Create a decryption key from a PEM-encoded private key.
Sourcepub fn encryption_key(&self) -> RsaOaepEncryptionKey
pub fn encryption_key(&self) -> RsaOaepEncryptionKey
Get the public encryption key.
Sourcepub fn with_key_id(self, key_id: impl Into<String>) -> Self
pub fn with_key_id(self, key_id: impl Into<String>) -> Self
Set the key ID.
Sourcepub fn encrypt<CustomClaims: Serialize>(
&self,
claims: JWTClaims<CustomClaims>,
) -> Result<String, Error>
pub fn encrypt<CustomClaims: Serialize>( &self, claims: JWTClaims<CustomClaims>, ) -> Result<String, Error>
Encrypt claims into a JWE token.
Sourcepub fn encrypt_with_options<CustomClaims: Serialize>(
&self,
claims: JWTClaims<CustomClaims>,
options: &EncryptionOptions,
) -> Result<String, Error>
pub fn encrypt_with_options<CustomClaims: Serialize>( &self, claims: JWTClaims<CustomClaims>, options: &EncryptionOptions, ) -> Result<String, Error>
Encrypt claims into a JWE token with options.
Sourcepub fn decrypt_token<CustomClaims: DeserializeOwned>(
&self,
token: &str,
options: Option<DecryptionOptions>,
) -> Result<JWTClaims<CustomClaims>, Error>
pub fn decrypt_token<CustomClaims: DeserializeOwned>( &self, token: &str, options: Option<DecryptionOptions>, ) -> Result<JWTClaims<CustomClaims>, Error>
Decrypt a JWE token and return the claims.
Sourcepub fn decode_metadata(token: &str) -> Result<JWETokenMetadata, Error>
pub fn decode_metadata(token: &str) -> Result<JWETokenMetadata, Error>
Decode token metadata without decrypting.
Trait Implementations§
Source§impl Clone for RsaOaepDecryptionKey
impl Clone for RsaOaepDecryptionKey
Source§fn clone(&self) -> RsaOaepDecryptionKey
fn clone(&self) -> RsaOaepDecryptionKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RsaOaepDecryptionKey
impl RefUnwindSafe for RsaOaepDecryptionKey
impl Send for RsaOaepDecryptionKey
impl Sync for RsaOaepDecryptionKey
impl Unpin for RsaOaepDecryptionKey
impl UnwindSafe for RsaOaepDecryptionKey
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