Class: RightScale::CachedCertificateStoreProxy
- Defined in:
- lib/right_agent/security/cached_certificate_store_proxy.rb
Overview
Proxy to actual certificate store which caches results in an LRU cache
Instance Method Summary collapse
-
#get_receiver(id) ⇒ Object
Retrieve receiver’s certificate and key for decryption Results are not cached.
-
#get_signer(id) ⇒ Object
Retrieve signer certificates for use in verifying a signature Check cache first and cache results.
-
#get_target(obj) ⇒ Object
Retrieve certificates of target for encryption Results are not cached.
-
#initialize(store) ⇒ CachedCertificateStoreProxy
constructor
Initialize cache proxy with given certificate store.
Constructor Details
#initialize(store) ⇒ CachedCertificateStoreProxy
Initialize cache proxy with given certificate store
Parameters
- store(Object)
-
Certificate store responding to get_signer, get_target,
and get_receiver
33 34 35 36 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 33 def initialize(store) @signer_cache = CertificateCache.new @store = store end |
Instance Method Details
#get_receiver(id) ⇒ Object
Retrieve receiver’s certificate and key for decryption Results are not cached
Parameters
- id(String|nil)
-
Optional identifier of source of data for use
in determining who is the receiver
Return
- (Array)
-
Certificate and key
71 72 73 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 71 def get_receiver(id) @store.get_receiver(id) end |
#get_signer(id) ⇒ Object
Retrieve signer certificates for use in verifying a signature Check cache first and cache results
Parameters
- id(String)
-
Serialized identity of signer
Return
- (Array|Certificate)
-
Signer certificate(s)
46 47 48 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 46 def get_signer(id) @signer_cache.get(id) { @store.get_signer(id) } end |
#get_target(obj) ⇒ Object
Retrieve certificates of target for encryption Results are not cached
Parameters
- packet(RightScale::Packet)
-
Packet containing target identity
Return
- (Array|Certificate)
-
Target certificate(s)
58 59 60 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 58 def get_target(obj) @store.get_target(obj) end |