code: function encodePBES2(decoded){
    const epki = { encryptionAlgorithm: {} };
  
    // algorithm
    epki.encryptionAlgorithm.algorithm = params.passwordBasedEncryptionSchemes[decoded.encryptionAlgorithm.algorithm].oid;
  
    // kdf
    const kdf = decoded.encryptionAlgorithm.parameters.keyDerivationFunc;
    if(kdf.algorithm === 'pbkdf2') {
      kdf.parameters.prf.algorithm = params.pbkdf2Prfs[kdf.parameters.prf.algorithm].oid;
      kdf.parameters = PBKDF2Params.encode(kdf.parameters, 'der');
    } else throw new Error('UnsupportedKDF');
    kdf.algorithm = params.keyDerivationFunctions[kdf.algorithm].oid;
  
    // encryptionScheme
    const eS = decoded.encryptionAlgorithm.parameters.encryptionScheme;
    if(Object.keys(PBES2ESParams).indexOf(eS.algorithm) >= 0){
      eS.parameters = PBES2ESParams[eS.algorithm].encode(eS.parameters, 'der');
    } else throw new Error('UnsupportedCipher');
    eS.algorithm = params.encryptionSchemes[eS.algorithm].oid;
  
    // params
    epki.encryptionAlgorithm.parameters = PBES2Params.encode({ keyDerivationFunc: kdf, encryptionScheme: eS }, 'der');
  
    // encoded data
    epki.encryptedData = decoded.encryptedData;
    return EncryptedPrivateKeyInfo.encode(epki, 'der');
  }
docs: ////////////////////////////