class String
Public Instance Methods
decrypt_bitlbee_password(key)
click to toggle source
Decrypt a bitlbee account password Used to decrypt passwords for individual IM accounts with the password of the bitlbee user
@param [String] key Key to decrypt with @return [String] The cleartext version of this string
# File lib/bitlbee_config/core_extensions/string.rb, line 40 def decrypt_bitlbee_password(key) cmd = Mixlib::ShellOut.new(" bitlbee -x dec '#{ key }' '#{ self }'") cmd.run_command cmd.error! cmd.stdout.chomp end
encrypt_bitlbee_password(key)
click to toggle source
Encrypt a bitlbee account password Used to encrypt passwords for individual IM accounts with the password of the bitlbee user
@param [String] key Key to encrypt with @return [String] The encrypted version of this string
# File lib/bitlbee_config/core_extensions/string.rb, line 28 def encrypt_bitlbee_password(key) cmd = Mixlib::ShellOut.new(" bitlbee -x enc '#{ key }' '#{ self }'") cmd.run_command cmd.error! cmd.stdout.chomp end
matches_bitlbee_password_hash?(hash)
click to toggle source
Check whether this string matches a given bitlbee password hash
@return [Boolean]
# File lib/bitlbee_config/core_extensions/string.rb, line 17 def matches_bitlbee_password_hash?(hash) cmd = Mixlib::ShellOut.new(" bitlbee -x chkhash '#{ hash }' '#{ self }'") cmd.run_command cmd.exitstatus == 0 end
to_bitlbee_password_hash()
click to toggle source
Get the bitlbee password hash for this string
@return [String] The bitlbee password hash for this string
# File lib/bitlbee_config/core_extensions/string.rb, line 7 def to_bitlbee_password_hash cmd = Mixlib::ShellOut.new(" bitlbee -x hash '#{ self }'") cmd.run_command cmd.error! cmd.stdout.chomp end