Class SubtleCrypto

Hierarchy

  • SubtleCrypto

Implements

Methods

  • Parameters

    • algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params
    • baseKey: CryptoKey
    • derivedKeyType: AlgorithmIdentifier | HkdfParams | Pbkdf2Params | AesDerivedKeyParams | HmacImportParams
    • extractable: boolean
    • keyUsages: KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    • algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params
    • baseKey: CryptoKey
    • derivedKeyType: AlgorithmIdentifier | HkdfParams | Pbkdf2Params | AesDerivedKeyParams | HmacImportParams
    • extractable: boolean
    • keyUsages: Iterable<KeyUsage>

    Returns Promise<CryptoKey>

  • Generates a digest of the given data. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.

    It takes as its arguments an identifier for the digest algorithm to use and the data to digest. It returns a Promise which will be fulfilled with the digest.

    Note that this API does not support streaming input: you must read the entire input into memory before passing it into the digest function.

    Parameters

    • algorithm: AlgorithmIdentifier

      This may be a string or an object with a single property name that is a string. The string names the hash function to use. Supported values are:

      • "SHA-1" (but don't use this in cryptographic applications)
      • "SHA-256"
      • "SHA-384"
      • "SHA-512"
    • data: BufferSource

      An ArrayBuffer, a TypedArray or a DataView object containing the data to be digested

    Returns Promise<ArrayBuffer>

  • Parameters

    Returns Promise<JsonWebKey>

  • Parameters

    • format: "pkcs8" | "raw" | "spki"
    • key: CryptoKey

    Returns Promise<ArrayBuffer>

  • Parameters

    Returns Promise<ArrayBuffer | JsonWebKey>

  • Parameters

    • algorithm: "Ed25519"
    • extractable: boolean
    • keyUsages: readonly ("sign" | "verify")[]

    Returns Promise<CryptoKeyPair>

  • Parameters

    • algorithm: RsaHashedKeyGenParams | EcKeyGenParams
    • extractable: boolean
    • keyUsages: readonly KeyUsage[]

    Returns Promise<CryptoKeyPair>

  • Parameters

    • algorithm: Pbkdf2Params | AesKeyGenParams | HmacKeyGenParams
    • extractable: boolean
    • keyUsages: readonly KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    Returns Promise<CryptoKey | CryptoKeyPair>

  • Parameters

    • algorithm: RsaHashedKeyGenParams | EcKeyGenParams
    • extractable: boolean
    • keyUsages: readonly KeyUsage[]

    Returns Promise<CryptoKeyPair>

  • Parameters

    • algorithm: Pbkdf2Params | AesKeyGenParams | HmacKeyGenParams
    • extractable: boolean
    • keyUsages: readonly KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    Returns Promise<CryptoKey | CryptoKeyPair>

  • Parameters

    • format: "jwk"
    • keyData: JsonWebKey
    • algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
    • extractable: boolean
    • keyUsages: readonly KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    • format: "pkcs8" | "raw" | "spki"
    • keyData: BufferSource
    • algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
    • extractable: boolean
    • keyUsages: KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    • format: "jwk"
    • keyData: JsonWebKey
    • algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
    • extractable: boolean
    • keyUsages: readonly KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    • format: "pkcs8" | "raw" | "spki"
    • keyData: BufferSource
    • algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
    • extractable: boolean
    • keyUsages: Iterable<KeyUsage>

    Returns Promise<CryptoKey>

  • Parameters

    • format: KeyFormat
    • wrappedKey: BufferSource
    • unwrappingKey: CryptoKey
    • unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams
    • unwrappedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
    • extractable: boolean
    • keyUsages: KeyUsage[]

    Returns Promise<CryptoKey>

  • Parameters

    • format: KeyFormat
    • wrappedKey: BufferSource
    • unwrappingKey: CryptoKey
    • unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams
    • unwrappedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm
    • extractable: boolean
    • keyUsages: Iterable<KeyUsage>

    Returns Promise<CryptoKey>

Generated using TypeDoc