async encrypt (passphrase){
    if(this._isEncrypted) throw new Error('AlreadyEncrypted');
    const options = {encryptParams: {passphrase}};
    this._setAsn1(await this.export('der', options), 'der');

    return true;
  }
/**
   * Encrypt stored key and set the encrypted key to this instance.
   * @param passphrase {string}
   * @return {Promise<boolean>}
   */
Encrypt stored key and set the encrypted key to this instance.
@param passphrase {string}
@return {Promise}
Encrypt stored key and set the encrypted key to this instance . @param passphrase { string } @return { Promise }
async encrypt (passphrase){
    if(this._isEncrypted) throw new Error('AlreadyEncrypted');
    const options = {encryptParams: {passphrase}};
    this._setAsn1(await this.export('der', options), 'der');
    return true;
  }
async encrypt ( passphrase ) { if ( this . _isEncrypted ) throw new Error ( 'AlreadyEncrypted' ) ; const options = { encryptParams : { passphrase } } ; this . _setAsn1 ( await this . export ( 'der' , options ) , 'der' ) ; return true ; }
Encrypt stored key and set the encrypted key to this instance.
Encrypt stored key and set the encrypted key to this instance .