gossamer/subtle_crypto
Values
pub fn decrypt(
algorithm algorithm: encrypt_algorithm.EncryptAlgorithm,
key key: crypto_key.CryptoKey,
data data: uint8_array.Uint8Array,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn derive_bits(
algorithm algorithm: derive_algorithm.DeriveAlgorithm,
base_key key: crypto_key.CryptoKey,
length length: Int,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn derive_key(
algorithm algorithm: derive_algorithm.DeriveAlgorithm,
base_key key: crypto_key.CryptoKey,
derived_key_type type_: derived_key_type.DerivedKeyType,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(Result(crypto_key.CryptoKey, String))
pub fn digest(
algorithm algorithm: hash_algorithm.HashAlgorithm,
data data: uint8_array.Uint8Array,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn encrypt(
algorithm algorithm: encrypt_algorithm.EncryptAlgorithm,
key key: crypto_key.CryptoKey,
data data: uint8_array.Uint8Array,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn export_key(
format format: key_format.KeyFormat,
key key: crypto_key.CryptoKey,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn export_key_jwk(
key: crypto_key.CryptoKey,
) -> promise.Promise(Result(json_web_key.JsonWebKey, String))
pub fn generate_key(
algorithm algorithm: key_gen_algorithm.KeyGenAlgorithm,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(Result(crypto_key.CryptoKey, String))
pub fn generate_key_pair(
algorithm algorithm: key_pair_gen_algorithm.KeyPairGenAlgorithm,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(
Result(crypto_key_pair.CryptoKeyPair, String),
)
pub fn import_key(
format format: key_format.KeyFormat,
key_data data: uint8_array.Uint8Array,
algorithm algorithm: import_algorithm.ImportAlgorithm,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(Result(crypto_key.CryptoKey, String))
pub fn import_key_jwk(
key_data data: json_web_key.JsonWebKey,
algorithm algorithm: import_algorithm.ImportAlgorithm,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(Result(crypto_key.CryptoKey, String))
pub fn sign(
algorithm algorithm: sign_algorithm.SignAlgorithm,
key key: crypto_key.CryptoKey,
data data: uint8_array.Uint8Array,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn unwrap_key(
format format: key_format.KeyFormat,
wrapped_key wrapped_key: uint8_array.Uint8Array,
unwrapping_key unwrapping_key: crypto_key.CryptoKey,
unwrap_algorithm unwrap_algorithm: wrap_algorithm.WrapAlgorithm,
unwrapped_key_algorithm unwrapped_key_algorithm: import_algorithm.ImportAlgorithm,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(Result(crypto_key.CryptoKey, String))
pub fn unwrap_key_jwk(
wrapped_key wrapped_key: uint8_array.Uint8Array,
unwrapping_key unwrapping_key: crypto_key.CryptoKey,
unwrap_algorithm unwrap_algorithm: wrap_algorithm.WrapAlgorithm,
unwrapped_key_algorithm unwrapped_key_algorithm: import_algorithm.ImportAlgorithm,
extractable extractable: Bool,
usages usages: List(key_usage.KeyUsage),
) -> promise.Promise(Result(crypto_key.CryptoKey, String))
pub fn verify(
algorithm algorithm: sign_algorithm.SignAlgorithm,
key key: crypto_key.CryptoKey,
signature signature: uint8_array.Uint8Array,
data data: uint8_array.Uint8Array,
) -> promise.Promise(Result(Bool, String))
pub fn wrap_key(
format format: key_format.KeyFormat,
key key: crypto_key.CryptoKey,
wrapping_key wrapping_key: crypto_key.CryptoKey,
algorithm algorithm: wrap_algorithm.WrapAlgorithm,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn wrap_key_jwk(
key key: crypto_key.CryptoKey,
wrapping_key wrapping_key: crypto_key.CryptoKey,
algorithm algorithm: wrap_algorithm.WrapAlgorithm,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))