gossamer/crypto/key

A CryptoKey returned by a gossamer/crypto/subtle operation. Access its component data via info.

Types

A cryptographic key used with subtle operations (encryption, signing, key derivation, etc.).

See CryptoKey on MDN.

pub type CryptoKey

A snapshot of a CryptoKey’s parameters, returned by info. All fields are immutable after key generation.

pub type Info {
  Info(
    algorithm: crypto.KeyAlgorithm,
    kind: crypto.KeyKind,
    usages: List(crypto.KeyUsage),
    extractable: Bool,
  )
}

Constructors

  • Info(
      algorithm: crypto.KeyAlgorithm,
      kind: crypto.KeyKind,
      usages: List(crypto.KeyUsage),
      extractable: Bool,
    )

    Arguments

    algorithm

    The algorithm and parameters the key is bound to.

    kind

    Whether the key is Secret (symmetric), Public, or Private. Equivalent to JavaScript’s CryptoKey.type.

    usages

    The operations the key is permitted for (encrypt, decrypt, sign, verify, etc.). subtle operations check this list before running.

    extractable

    True if the key can be exported via subtle.export_key or subtle.export_key_jwk.

Values

pub fn info(key: CryptoKey) -> Info

A snapshot of the key’s algorithm, kind, usages, and extractability.

Search Document