Algorithm
The Algorithm enum represents Web Crypto algorithm parameters. Each variant maps to a specific algorithm and carries the fields needed for the operation.
Variants
Signature
| Variant | Fields |
|---|---|
RsassaPkcs1v15 | hash: Hash |
RsaPss | hash: Hash, salt_length: Option<u32> |
Ecdsa | hash: Hash, named_curve: NamedCurve |
Ed25519 | (none) |
Encryption
| Variant | Fields |
|---|---|
RsaOaep | hash: Hash, label: Option<Vec<u8>> |
AesCtr | counter: Option<Vec<u8>>, length: Option<u8>, key_length: Option<u16> |
AesCbc | iv: Option<Vec<u8>>, key_length: Option<u16> |
AesGcm | iv: Option<Vec<u8>>, additional_data: Option<Vec<u8>>, tag_length: Option<u8>, key_length: Option<u16> |
Key Wrapping
| Variant | Fields |
|---|---|
AesKw | key_length: Option<u16> |
Key Derivation
| Variant | Fields |
|---|---|
Ecdh | named_curve: NamedCurve, public_key: Option<CryptoKey> |
X25519 | public_key: Option<CryptoKey> |
Hkdf | hash: Hash, salt: Option<Vec<u8>>, info: Option<Vec<u8>> |
Pbkdf2 | hash: Hash, salt: Option<Vec<u8>>, iterations: Option<u32> |
MAC
| Variant | Fields |
|---|---|
Hmac | hash: Hash, length: Option<u32> |
Hash
| Variant | Web Crypto name |
|---|---|
Sha1 | SHA-1 |
Sha256 | SHA-256 |
Sha384 | SHA-384 |
Sha512 | SHA-512 |
NamedCurve
| Variant | Web Crypto name |
|---|---|
P256 | P-256 |
P384 | P-384 |
P521 | P-521 |
GenerateKeyParams
Used with generate_key to specify key generation parameters that go beyond the Algorithm enum.
| Variant | Fields |
|---|---|
Rsa | algorithm: Algorithm, modulus_length: u32, public_exponent: Vec<u8> |
Ec | algorithm: Algorithm |
Aes | algorithm: Algorithm, length: u16 |
Hmac | algorithm: Algorithm |
Ed25519 | (none) |
X25519 | (none) |