code: async function decryptPBES2(decoded, passphrase){
    const kdf = decoded.encryptionAlgorithm.parameters.keyDerivationFunc;
    const eS = decoded.encryptionAlgorithm.parameters.encryptionScheme;
  
    // pbkdf2
    const keyLength = params.encryptionSchemes[eS.algorithm].keyLength; // get keyLength
    let key;
    if(kdf.algorithm === 'pbkdf2') {
      const pBuffer = jseu.encoder.stringToArrayBuffer(passphrase);
      if (kdf.parameters.salt.type !== 'specified') throw new Error('UnsupportedSaltSource');
      const salt = new Uint8Array(kdf.parameters.salt.value);
      const iterationCount = kdf.parameters.iterationCount.toNumber();
      const prf = kdf.parameters.prf.algorithm;
      key = await pbkdf.pbkdf2(pBuffer, salt, iterationCount, keyLength, params.pbkdf2Prfs[prf].hash);
    }
    else throw new Error('UnsupportedKDF');
  
    // decryption
    // TODO other encryption schemes
    let out;
    if(eS.algorithm === 'des-ede3-cbc'){
      const iv = eS.parameters;
      const CBC = des.CBC.instantiate(des.EDE);
      const pt = CBC.create({ type: 'decrypt', key, iv });
      out = Buffer.from(pt.update(decoded.encryptedData).concat(pt.final()));
    }
    else if (eS.algorithm === 'aes128-cbc' || eS.algorithm === 'aes192-cbc'|| eS.algorithm === 'aes256-cbc'){
      const iv = new Uint8Array(eS.parameters);
      out = Buffer.from( await jscaes.decrypt(
        new Uint8Array(decoded.encryptedData), key, {name: 'AES-CBC', iv}
      ));
    } else throw new Error('UnsupportedEncryptionAlgorithm');
  
    return OneAsymmetricKey.decode(out, 'der');
  }
docs: //////////////////////////// PBES2 RFC8018 Section 6.2.2