This module handles all standard key management features.
Creates a key for object based on given password and an optional salt.
# File lib/active_crypto.rb, line 127 def enter_password(password,salt="onetwothree") set_session_key(EzCrypto::Key.with_password(password, salt)) end
Returns the session_key
# File lib/active_crypto.rb, line 148 def session_key @session_key end
Decodes the Base64 encoded key and uses it as it's session key
# File lib/active_crypto.rb, line 134 def set_encoded_key(enc) set_session_key(EzCrypto::Key.decode(enc)) end
Sets a session key for the object. This should be a EzCrypto::Key instance.
# File lib/active_crypto.rb, line 140 def set_session_key(key) @session_key=key self.decrypt_attributes if self.class.include? Encrypted end
Generated with the Darkfish Rdoc Generator 2.