interface CryptoAdapter { decryptAes256Cbc(ciphertext: Uint8Array,
key: Uint8Array): Promise<Uint8Array>; encryptAes256Cbc(plaintext: Uint8Array,
key: Uint8Array): Promise<Uint8Array>; getRandomValues(array: Uint8Array): Uint8Array; sha256(data: ArrayBuffer): Uint8Array; } Methods
decryptAes256Cbc
- decryptAes256Cbc(ciphertext, key): Promise<Uint8Array>
Parameters
- ciphertext: Uint8Array
- key: Uint8Array
Returns Promise<Uint8Array>
encryptAes256Cbc
- encryptAes256Cbc(plaintext, key): Promise<Uint8Array>
Parameters
- plaintext: Uint8Array
- key: Uint8Array
Returns Promise<Uint8Array>
getRandomValues
- getRandomValues(array): Uint8Array
Returns Uint8Array
sha256
- sha256(data): Uint8Array
Returns Uint8Array
The CryptoAdapter interface used by Crypto class
Out of the box, @signumjs/crypto provides web and nodejs using this interface
One might need to implement this interface for other environments, i.e. React Native and use Crypto.init