@signumjs/crypto
Version:
Cryptographic functions for building Signum Network apps.
29 lines (28 loc) • 1.14 kB
TypeScript
import { CryptoAdapter } from '../typings/cryptoAdapter';
/**
* Unified Low-Level Crypto Class for common crypto operations needed for Signum.
*
* IMPORTANT: Before using any of the crypto functions {@link init()} needs to be called once
*
* Usually, you want to use the comfort functions like
* {@link encryptData}, {@link encryptMessage}, {@link decryptData}, {@link decryptData}, {@link getRandomBytes}, etc.
*
* Interacting with this class maybe necessary in cases where the underlying crypto implementations need to be
* customized, i.e. React Native
*
*/
export declare class Crypto {
private static cryptoAdapter;
/**
* The adapter gives access to required crypto methods
*/
static get adapter(): CryptoAdapter;
/**
* Initializes the crypto module with platform specific {@link CryptoAdapter}
*
* This must be called, before any of the crypto functions is being used
*
* @param cryptoAdapter The platform specific adapter, e.g. {@link NodeJSCryptoAdapter}, {@link WebCryptoAdapter}, or any other provider
*/
static init(cryptoAdapter: CryptoAdapter): void;
}