module SecureDataBag::Decryptor

Public Class Methods

for(encrypted_hash, secret, metadata = {}) click to toggle source

Instantiate an Decryptor object responsable for decrypting the encrypted_hash with the secret. As much as possible, this method will attempt to auto-detect the item format to ensure compatibility.

Much like with upstream, call for_encrypted_item on the resulting object to decrypt and deserialize it.

@param encrypted_hash [Hash] the encrypted hash to decrypt @param secret [String] @param metadata [Hash] the optional metdata to configure the decryptor @return [SecureDataBag::NestedDecryptor] the object capable of decrypting @since 3.0.0

# File lib/secure_data_bag/decryptor.rb, line 18
def self.for(encrypted_hash, secret, metadata = {})
  metadata = Mash.new(metadata)
  NestedDecryptor.new(encrypted_hash, secret, metadata)
end