js-crypto-key-utils
Version:
Universal Module for Cryptographic Key Utilities in JavaScript, including PEM-JWK converters
22 lines (21 loc) • 851 B
TypeScript
/**
* rfc8081
*/
import { AsnEncryptOptionsWithPassphrase, DER } from './typedef';
/**
* Generate EncryptedPrivateKeyInfo ASN.1 object.
* @param {DER} binKey - Binary key in DER format.
* @param {AsnEncryptOptionsWithPassphrase} [options={passphrase: ''}] - Encryption options for ASN.1 private key.
* @return {Promise<DER>} - Encrypted private key in DER.
*/
export declare const encryptEncryptedPrivateKeyInfo: (binKey: DER, options?: AsnEncryptOptionsWithPassphrase) => Promise<DER>;
/**
* Decrypt EncryptedPrivateKeyInfo
* @param {Object} epki - Parsed encrypted
* @param {String} passphrase - Passphrase to decyrpt the object.
* @return {Promise<Object>} - Decrypted object.
*/
export declare const decryptEncryptedPrivateKeyInfo: (epki: {
encryptionAlgorithm: any;
encryptedData: any;
}, passphrase: string) => Promise<any>;