Module: SecureDataBag::Decryptor

Defined in:
lib/secure_data_bag/decryptor.rb

Class Method Summary collapse

Class Method Details

.for(encrypted_hash, secret, metadata = {}) ⇒ SecureDataBag::NestedDecryptor

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.

Parameters:

  • encrypted_hash (Hash)

    the encrypted hash to decrypt

  • secret (String)
  • metadata (Hash) (defaults to: {})

    the optional metdata to configure the decryptor

Returns:

Since:

  • 3.0.0



18
19
20
21
# File 'lib/secure_data_bag/decryptor.rb', line 18

def self.for(encrypted_hash, secret,  = {})
   = Mash.new()
  NestedDecryptor.new(encrypted_hash, secret, )
end