CryptoKeyStorage

February 14, 2019 ยท View on GitHub

Crypto storage for private, public and secret keys keeping. Extends CryptoStorage.

Interfaces

CryptoKeyStorage interface

interface CryptoKeyStorage extends CryptoStorage<CryptoKey> {

  getItem(index: string): Promise<CryptoKey>;
  getItem(index: string, algorithm: ImportAlgorithms, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;

}

Operations

Get item

Returns CryptoKey from key storage.

Key getting with default params

const key = await crypto.keyStorage.getItem("0001");

Key getting with import params

const key = await crypto.keyStorage.getItem("0001", {name: "RSASSA-PKCS1-v1_5", hash: "SHA-256"}, false, ["sign"]);