Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 815 Bytes

KEY_STORAGE.md

File metadata and controls

30 lines (21 loc) · 815 Bytes

CryptoKeyStorage

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"]);