Method: Chef::EncryptedAttribute::EncryptedMash::Version1#can_be_decrypted_by?

Defined in:
lib/chef/encrypted_attribute/encrypted_mash/version1.rb

#can_be_decrypted_by?(keys) ⇒ Boolean

Checks if the current Chef::EncryptedAttribute::EncryptedMash can be decrypted by all of the provided keys.

Parameters:

  • keys (Array<OpenSSL::PKey::RSA>)

    list of public keys.

Returns:

  • (Boolean)

    true if all keys can decrypt the data.

Raises:



178
179
180
181
# File 'lib/chef/encrypted_attribute/encrypted_mash/version1.rb', line 178

def can_be_decrypted_by?(keys)
  return false unless encrypted?
  data_can_be_decrypted_by_keys?(self['encrypted_secret'], keys)
end