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