Module: Mint::AesEncryption
- Extended by:
- AesEncryption
- Included in:
- AesEncryption
- Defined in:
- src/mintpress-encryption/lib/mintpress-encryption.rb
Overview
A ruby implementation of the java EnvMintUtilities methods used for the
encryption/decryption of secrets within the MINT model.
Constant Summary collapse
- LOCAL_KEY_PATH =
".limepoint/localKey".freeze
Instance Method Summary collapse
- #decrypt(in_secret) ⇒ Object
- #encrypt(secret, transportable_key = true) ⇒ Object
- #encrypted?(secret) ⇒ Boolean
-
#generate_transportable_key(user: Etc.getpwuid.name, chef: true) ⇒ Object
The installer (and only the installer) will invoke this method to generate the encrypted key and write it to the file localKey This method will be invoked from the installer only for new install.
- #get_local_key(user: Etc.getpwuid.name) ⇒ Object
-
#lookup_key_from_chef_data_bag ⇒ Object
Retrieve the encrypted key from the data bag.
-
#save_key_to_chef_data_bag(user, encrypted_key) ⇒ Object
The installer (and only the installer) will invoke this method passing to it the encrypted_key (obtained from localKey) 1.
-
#save_key_to_file(file, encrypted_key) ⇒ Object
Save the encrypted key to the file only if the file doesn't exist.
- #trace(msg) ⇒ Object
-
#validate_transportable_key(user: Etc.getpwuid.name, chef: true) ⇒ Object
The installer (and only the installer) will invoke this method to validate the encrypted key is present in the file system and the chef data bag This method will be invoked from the installer only for upgrade.
-
#write_chef_key_to_disk ⇒ Object
This method will be explicitly invoked from environmint-common library (write-key.rb).
Instance Method Details
#decrypt(in_secret) ⇒ Object
#encrypt(secret, transportable_key = true) ⇒ Object
#encrypted?(secret) ⇒ Boolean
#generate_transportable_key(user: Etc.getpwuid.name, chef: true) ⇒ Object
The installer (and only the installer) will invoke this method to generate the encrypted key and write it to the file localKey
This method will be invoked from the installer only for new install
#get_local_key(user: Etc.getpwuid.name) ⇒ Object
#lookup_key_from_chef_data_bag ⇒ Object
Retrieve the encrypted key from the data bag
#save_key_to_chef_data_bag(user, encrypted_key) ⇒ Object
The installer (and only the installer) will invoke this method passing to it the encrypted_key (obtained from localKey)
1. Store the localKey value ito data bag, if the data bag is empty (first time set up)
2. Return if the previous value in the data bag is same as the localKey (re-run of installer)
3. Raise exception if the existing data bad key and localKey does not match
#save_key_to_file(file, encrypted_key) ⇒ Object
Save the encrypted key to the file only if the file doesn't exist
#trace(msg) ⇒ Object
#validate_transportable_key(user: Etc.getpwuid.name, chef: true) ⇒ Object
The installer (and only the installer) will invoke this method to validate the encrypted key is
present in the file system and the chef data bag
This method will be invoked from the installer only for upgrade
#write_chef_key_to_disk ⇒ Object
This method will be explicitly invoked from environmint-common library (write-key.rb)