Module: ActiveCrypto::AssociationKeyHolder

### Home Classes Methods

### In Files

- lib/active_crypto.rb

### Methods

- #save_session_key
- #session_key
- #session_key_id
- #set_session_key

### Included Modules

- ActiveCrypto::KeyHolder

### Files

- CHANGELOG
- README.rdoc
- README_ACTIVE_CRYPTO
- README_DIGITAL_SIGNATURES

### Class/Module Index

Quicksearch

- EzCrypto
- EzCrypto::Certificate
- EzCrypto::Digester
- EzCrypto::Key
- EzCrypto::Name
- EzCrypto::Signer
- EzCrypto::TrustStore
- EzCrypto::Verifier
- ActiveCrypto
- ActiveCrypto::AssociationKeyHolder
- ActiveCrypto::ClassMethods
- ActiveCrypto::Encrypted
- ActiveCrypto::Encrypted::ClassAccessors
- ActiveCrypto::KeyHolder
- ActiveCrypto::MissingKeyError

No matching classes.

# ActiveCrypto::AssociationKeyHolder

### Public Instance Methods

save_session_key() click to toggle source

    # File lib/active_crypto.rb, line 158
    def save_session_key
      ActiveRecord::Base.session_keys[session_key_id]=@session_key if @session_key
    end

session_key() click to toggle source

Returns the session_key

    # File lib/active_crypto.rb, line 177
    def session_key
      if self.new_record?
        @session_key
      else
        ActiveRecord::Base.session_keys[session_key_id]
      end
    end

session_key_id() click to toggle source

    # File lib/active_crypto.rb, line 187
    def session_key_id
      "#{self.class.to_s}:#{id}"
    end

set_session_key(key) click to toggle source

Sets a session key for the object. This should be a EzCrypto::Key instance.

    # File lib/active_crypto.rb, line 164
    def set_session_key(key)
      if self.new_record?
        @session_key=key
      else
        ActiveRecord::Base.session_keys[session_key_id]=key
      end
      decrypt_attributes if self.class.include? Encrypted #if respond_to?(:decrypt_attributes)

    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.