Enum biscuit::jwa::ContentEncryptionAlgorithm
[−]
[src]
pub enum ContentEncryptionAlgorithm { A128CBC_HS256, A192CBC_HS384, A256CBC_HS512, A128GCM, A192GCM, A256GCM, }
Algorithms meant for content encryption. See RFC7518#5
Variants
A128CBC_HS256
AES_128_CBC_HMAC_SHA_256 authenticated encryption algorithm enc
A192CBC_HS384
AES_192_CBC_HMAC_SHA_384 authenticated encryption algorithm enc
A256CBC_HS512
AES_256_CBC_HMAC_SHA_512 authenticated encryption algorithm enc
A128GCM
AES GCM using 128-bit key
A192GCM
AES GCM using 192-bit key
This is not supported by ring
.
A256GCM
AES GCM using 256-bit key
Methods
impl ContentEncryptionAlgorithm
[src]
fn generate_key(&self) -> Result<Vec<u8>, Error>
Convenience function to generate a new random key with the required length
fn encrypt<T: Serialize + DeserializeOwned>(
&self,
payload: &[u8],
aad: &[u8],
key: &JWK<T>
) -> Result<EncryptionResult, Error>
&self,
payload: &[u8],
aad: &[u8],
key: &JWK<T>
) -> Result<EncryptionResult, Error>
Encrypt some payload with the provided algorith
fn decrypt<T: Serialize + DeserializeOwned>(
&self,
encrypted: &EncryptionResult,
key: &JWK<T>
) -> Result<Vec<u8>, Error>
&self,
encrypted: &EncryptionResult,
key: &JWK<T>
) -> Result<Vec<u8>, Error>
Decrypt some payload with the provided algorith,
Trait Implementations
impl Debug for ContentEncryptionAlgorithm
[src]
impl Eq for ContentEncryptionAlgorithm
[src]
impl PartialEq for ContentEncryptionAlgorithm
[src]
fn eq(&self, __arg_0: &ContentEncryptionAlgorithm) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Copy for ContentEncryptionAlgorithm
[src]
impl Clone for ContentEncryptionAlgorithm
[src]
fn clone(&self) -> ContentEncryptionAlgorithm
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more