pub struct EcdhEsA128KWDecryptionKey { /* private fields */ }Expand description
P-256 key pair for ECDH-ES+A128KW decryption.
Implementations§
Source§impl EcdhEsA128KWDecryptionKey
impl EcdhEsA128KWDecryptionKey
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Create from raw scalar bytes.
Sourcepub fn encryption_key(&self) -> EcdhEsA128KWEncryptionKey
pub fn encryption_key(&self) -> EcdhEsA128KWEncryptionKey
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 EcdhEsA128KWDecryptionKey
impl Clone for EcdhEsA128KWDecryptionKey
Source§fn clone(&self) -> EcdhEsA128KWDecryptionKey
fn clone(&self) -> EcdhEsA128KWDecryptionKey
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 moreAuto Trait Implementations§
impl Freeze for EcdhEsA128KWDecryptionKey
impl RefUnwindSafe for EcdhEsA128KWDecryptionKey
impl Send for EcdhEsA128KWDecryptionKey
impl Sync for EcdhEsA128KWDecryptionKey
impl Unpin for EcdhEsA128KWDecryptionKey
impl UnsafeUnpin for EcdhEsA128KWDecryptionKey
impl UnwindSafe for EcdhEsA128KWDecryptionKey
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