[][src]Enum biscuit::jwa::KeyManagementAlgorithm

pub enum KeyManagementAlgorithm {
    RSA1_5,
    RSA_OAEP,
    RSA_OAEP_256,
    A128KW,
    A192KW,
    A256KW,
    DirectSymmetricKey,
    ECDH_ES,
    ECDH_ES_A128KW,
    ECDH_ES_A192KW,
    ECDH_ES_A256KW,
    A128GCMKW,
    A192GCMKW,
    A256GCMKW,
    PBES2_HS256_A128KW,
    PBES2_HS384_A192KW,
    PBES2_HS512_A256KW,
}

Algorithms for key management as defined in RFC7518#4

Variants

RSA1_5

RSAES-PKCS1-v1_5

RSA_OAEP

RSAES OAEP using default parameters

RSA_OAEP_256

RSAES OAEP using SHA-256 and MGF1 with SHA-256

A128KW

AES Key Wrap using 128-bit key. Unsupported

A192KW

AES Key Wrap using 192-bit key. Unsupported. This is not supported by ring.

A256KW

AES Key Wrap using 256-bit key. Unsupported

DirectSymmetricKey

Direct use of a shared symmetric key

ECDH_ES

ECDH-ES using Concat KDF

ECDH_ES_A128KW

ECDH-ES using Concat KDF and "A128KW" wrapping

ECDH_ES_A192KW

ECDH-ES using Concat KDF and "A192KW" wrapping

ECDH_ES_A256KW

ECDH-ES using Concat KDF and "A256KW" wrapping

A128GCMKW

Key wrapping with AES GCM using 128-bit key alg

A192GCMKW

Key wrapping with AES GCM using 192-bit key alg. This is not supported by ring.

A256GCMKW

Key wrapping with AES GCM using 256-bit key alg

PBES2_HS256_A128KW

PBES2 with HMAC SHA-256 and "A128KW" wrapping

PBES2_HS384_A192KW

PBES2 with HMAC SHA-384 and "A192KW" wrapping

PBES2_HS512_A256KW

PBES2 with HMAC SHA-512 and "A256KW" wrapping

Implementations

impl KeyManagementAlgorithm[src]

pub fn algorithm_type(self) -> KeyManagementAlgorithmType[src]

Returns the type of operations that the algorithm is intended to support

pub fn cek<T>(
    self,
    content_alg: ContentEncryptionAlgorithm,
    key: &JWK<T>
) -> Result<JWK<Empty>, Error> where
    T: Serialize + DeserializeOwned
[src]

Return the Content Encryption Key (CEK) based on the key management algorithm

If the algorithm is dir or DirectSymmetricKey, the key provided is the CEK. Otherwise, the appropriate algorithm will be used to derive or generate the required CEK using the provided key.

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

Encrypt or wrap a Content Encryption Key with the provided algorithm

pub fn unwrap_key<T: Serialize + DeserializeOwned>(
    self,
    encrypted: &EncryptionResult,
    content_alg: ContentEncryptionAlgorithm,
    key: &JWK<T>
) -> Result<JWK<Empty>, Error>
[src]

Decrypt or unwrap a CEK with the provided algorithm

Trait Implementations

impl Clone for KeyManagementAlgorithm[src]

impl Copy for KeyManagementAlgorithm[src]

impl Debug for KeyManagementAlgorithm[src]

impl Default for KeyManagementAlgorithm[src]

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

impl Eq for KeyManagementAlgorithm[src]

impl PartialEq<KeyManagementAlgorithm> for KeyManagementAlgorithm[src]

impl Serialize for KeyManagementAlgorithm[src]

impl StructuralEq for KeyManagementAlgorithm[src]

impl StructuralPartialEq for KeyManagementAlgorithm[src]

Auto Trait Implementations

impl RefUnwindSafe for KeyManagementAlgorithm

impl Send for KeyManagementAlgorithm

impl Sync for KeyManagementAlgorithm

impl Unpin for KeyManagementAlgorithm

impl UnwindSafe for KeyManagementAlgorithm

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, 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.