code: function _decryptSafeContents(data, password) {
    var capture = {};
    var errors = [];
    if(!asn1.validate(
      data, forge.pkcs7.asn1.encryptedDataValidator, capture, errors)) {
      var error = new Error('Cannot read EncryptedContentInfo.');
      error.errors = errors;
      throw error;
    }
  
    var oid = asn1.derToOid(capture.contentType);
    if(oid !== pki.oids.data) {
      var error = new Error(
        'PKCS#12 EncryptedContentInfo ContentType is not Data.');
      error.oid = oid;
      throw error;
    }
  
    // get cipher
    oid = asn1.derToOid(capture.encAlgorithm);
    var cipher = pki.pbe.getCipher(oid, capture.encParameter, password);
  
    // get encrypted data
    var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1);
    var encrypted = forge.util.createBuffer(encryptedContentAsn1.value);
  
    cipher.update(encrypted);
    if(!cipher.finish()) {
      throw new Error('Failed to decrypt PKCS#12 SafeContents.');
    }
  
    return cipher.output.getBytes();
  }
docs: Decrypt PKCS#7 EncryptedData structure.
  
  @param data ASN.1 encoded EncryptedContentInfo object.
  @param password The user-provided password.
  
  @return The decrypted SafeContents (ASN.1 object).