Options
All
  • Public
  • Public/Protected
  • All
Menu

Cryptography provider API.

Hierarchy

  • CryptoProvider

Index

Methods

buffer2hex

  • buffer2hex(buffer: ArrayBuffer): string
  • Converts a buffer to hex string.

    Parameters

    • buffer: ArrayBuffer

      The buffer to convert.

    Returns string

    The hex string.

decrypt

  • decrypt(key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer>
  • Decrypt using Key

    Parameters

    • key: CryptoKey

      Key to use.

    • data: ArrayBuffer

      Data to decrypt.

    Returns Promise<ArrayBuffer>

deriveFromKM

  • deriveFromKM(keyMaterial: CryptoKey, salt: any): Promise<CryptoKey>
  • Derive key from KeyMaterial

    Parameters

    • keyMaterial: CryptoKey

      Key Material to use.

    • salt: any

      The salt.

    Returns Promise<CryptoKey>

encrypt

  • Encrypt using Key

    Parameters

    • key: CryptoKey

      Key to use.

    • data: ArrayBuffer

      Data to encrypt.

    Returns Promise<EncryptionResult>

passwordToKM

  • passwordToKM(password: string): Promise<CryptoKey>
  • Converts a password to a Key Material. Requires Crypto API.

    Parameters

    • password: string

      Password to use.

    Returns Promise<CryptoKey>

simpleDigest

  • simpleDigest(text: string, algorithm?: string): Promise<ArrayBuffer>
  • Simple digest function.

    Default hash function is SHA-256.

    Parameters

    • text: string

      The text to hash.

    • Optional algorithm: string

      The algorithm to use. Default is "SHA-256".

    Returns Promise<ArrayBuffer>

    The hashed data.

Generated using TypeDoc