///
import { KeyObject } from 'crypto';
declare type KeyPair = {
privateKey: KeyObject;
publicKey: KeyObject;
};
declare type EncryptionContext = {
nonce: Buffer;
passphrase: Buffer;
};
declare type DecryptionContext = EncryptionContext & {
authTag: Buffer;
};
export default class CryptoContext {
_generateNonce(): Promise;
_generateKeyPair(): Promise;
_generatePassphrase(nonce: Buffer): Promise;
private _saveNonce;
_savePrivateKey(privateKey: KeyObject, nonce: Buffer): Promise;
_savePassphrase(passphrase: Buffer, publicKey: KeyObject): Promise;
_saveAuthTag(authTag: Buffer): Promise;
_loadAuthTag(): Promise;
private _loadNonce;
_loadPrivateKey(nonce: Buffer): Promise;
_loadPassphrase(privateKey: KeyObject): Promise;
_generateEncryptionKeys(): Promise;
_loadDecryptionKeys(): Promise;
private _createCipher;
private _createDecipher;
encrypt(data: Buffer): Promise;
decrypt(data: Buffer): Promise;
}
export {};