Module: KnifeHitori::CryptUtil
- Included in:
- Chef::Knife::HitoriFileDec, Chef::Knife::HitoriFileEnc
- Defined in:
- lib/knife-hitori/lib/crypt_util.rb
Instance Method Summary collapse
Instance Method Details
#decrypt(data, secret) ⇒ String
10 11 12 |
# File 'lib/knife-hitori/lib/crypt_util.rb', line 10 def decrypt(data, secret) Chef::EncryptedDataBagItem::Decryptor.for(data, secret.strip).for_decrypted_item end |
#encrypt(data, secret) ⇒ Hash
17 18 19 |
# File 'lib/knife-hitori/lib/crypt_util.rb', line 17 def encrypt(data, secret) Chef::EncryptedDataBagItem::Encryptor.new(data, secret.strip).for_encrypted_item end |