Enum openid::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

Implementations

impl ContentEncryptionAlgorithm[src]

pub fn generate_key(self) -> Result<Vec<u8, Global>, Error>[src]

Convenience function to generate a new random key with the required length

pub fn encrypt<T>(
    self,
    payload: &[u8],
    aad: &[u8],
    key: &JWK<T>,
    options: &EncryptionOptions
) -> Result<EncryptionResult, Error> where
    T: Serialize + DeserializeOwned
[src]

Encrypt some payload with the provided algorith

pub fn decrypt<T>(
    self,
    encrypted: &EncryptionResult,
    key: &JWK<T>
) -> Result<Vec<u8, Global>, Error> where
    T: Serialize + DeserializeOwned
[src]

Decrypt some payload with the provided algorith,

Trait Implementations

impl Clone for ContentEncryptionAlgorithm[src]

impl Copy for ContentEncryptionAlgorithm[src]

impl Debug for ContentEncryptionAlgorithm[src]

impl Default for ContentEncryptionAlgorithm[src]

impl<'de> Deserialize<'de> for ContentEncryptionAlgorithm[src]

impl Eq for ContentEncryptionAlgorithm[src]

impl PartialEq<ContentEncryptionAlgorithm> for ContentEncryptionAlgorithm[src]

impl Serialize for ContentEncryptionAlgorithm[src]

impl StructuralEq for ContentEncryptionAlgorithm[src]

impl StructuralPartialEq for ContentEncryptionAlgorithm[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.