Enum biscuit::jwa::KeyManagementAlgorithm
[−]
[src]
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
Methods
impl KeyManagementAlgorithm
[src]
fn algorithm_type(&self) -> KeyManagementAlgorithmType
Returns the type of operations that the algorithm is intended to support
fn cek<T>(
&self,
content_alg: ContentEncryptionAlgorithm,
key: &JWK<T>
) -> Result<JWK<Empty>, Error> where
T: Serialize + DeserializeOwned,
&self,
content_alg: ContentEncryptionAlgorithm,
key: &JWK<T>
) -> Result<JWK<Empty>, Error> where
T: Serialize + DeserializeOwned,
Retrieve the Content Encryption Key (CEK) based on the algorithm for encryption
fn encrypt<T: Serialize + DeserializeOwned>(
&self,
payload: &[u8],
key: &JWK<T>
) -> Result<EncryptionResult, Error>
&self,
payload: &[u8],
key: &JWK<T>
) -> Result<EncryptionResult, Error>
Encrypt or wrap a key with the provided algorithm
fn decrypt<T: Serialize + DeserializeOwned>(
&self,
encrypted: &EncryptionResult,
content_alg: ContentEncryptionAlgorithm,
key: &JWK<T>
) -> Result<JWK<Empty>, Error>
&self,
encrypted: &EncryptionResult,
content_alg: ContentEncryptionAlgorithm,
key: &JWK<T>
) -> Result<JWK<Empty>, Error>
Decrypt or unwrap a CEK with the provided algorithm
Trait Implementations
impl Debug for KeyManagementAlgorithm
[src]
impl Eq for KeyManagementAlgorithm
[src]
impl PartialEq for KeyManagementAlgorithm
[src]
fn eq(&self, __arg_0: &KeyManagementAlgorithm) -> 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 KeyManagementAlgorithm
[src]
impl Clone for KeyManagementAlgorithm
[src]
fn clone(&self) -> KeyManagementAlgorithm
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