Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

decrypt

  • decrypt(data: Uint8Array, encryptionKey: CryptoKey): Promise<Uint8Array>
  • decrypt decrypts the given ciphertext.

    Parameters

    • data: Uint8Array
    • encryptionKey: CryptoKey

      The secret key used to decrypt (same as the one to encrypt, generated by generateEncryptionKey).

    Returns Promise<Uint8Array>

encrypt

  • encrypt(plaintext: Uint8Array, encryptionKey: CryptoKey): Promise<Uint8Array>
  • encrypt returns the ciphertext of the given plaintext.

    Parameters

    • plaintext: Uint8Array
    • encryptionKey: CryptoKey

      The secret key used to encrypt (generated by generateEncryptionKey).

    Returns Promise<Uint8Array>

exportKey

  • exportKey(cryptoKey: CryptoKey): Promise<JsonWebKey>

fromB64

  • fromB64(keyDataB64: string): JsonWebKey
  • fromB64 decodes the given Base64 to the corresponding JSON Web Key representation.

    Parameters

    • keyDataB64: string

    Returns JsonWebKey

generateEncryptionKey

  • generateEncryptionKey(): Promise<CryptoKey>

importKey

  • importKey(cryptoKeyData: JsonWebKey): Promise<CryptoKey>
  • importKey imports a JSON Web Key to a CryptoKey. The JSON Web Key should be the same as returned by exportKey.

    Parameters

    • cryptoKeyData: JsonWebKey

    Returns Promise<CryptoKey>

toB64

  • toB64(keyData: JsonWebKey): string
  • toB64 encodes the given JSON Web Key to the base64 representation

    Parameters

    • keyData: JsonWebKey

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc