Class: RightScale::StaticCertificateStore

Inherits:
Object
  • Object
show all
Defined in:
lib/right_agent/security/static_certificate_store.rb

Overview

Simple certificate store, serves a static set of certificates

Instance Method Summary collapse

Constructor Details

#initialize(signer_certs, recipients_certs) ⇒ StaticCertificateStore

Initialize store

Parameters

signer_certs(Array|Certificate)

Signer certificate(s) used when loading data to

check the digital signature. The signature associated with the serialized data
needs to match with one of the signer certificates for loading to succeed.
recipients_certs(Array|Certificate)

Recipient certificate(s) used when serializing

data for encryption. Loading the data can only be done through serializers that
have been initialized with a certificate that's in the recipient certificates
if encryption is enabled.


38
39
40
41
42
43
# File 'lib/right_agent/security/static_certificate_store.rb', line 38

def initialize(signer_certs, recipients_certs)
  signer_certs = [ signer_certs ] unless signer_certs.respond_to?(:each)
  @signer_certs = signer_certs 
  recipients_certs = [ recipients_certs ] unless recipients_certs.respond_to?(:each)
  @recipients_certs = recipients_certs
end

Instance Method Details

#get_recipients(packet) ⇒ Object

Retrieve recipient certificates that will be able to decrypt the serialized data

Parameters

packet(RightScale::Packet)

Packet containing recipient identity, ignored

Return

(Array)

Recipient certificates



63
64
65
# File 'lib/right_agent/security/static_certificate_store.rb', line 63

def get_recipients(packet)
  @recipients_certs
end

#get_signer(id) ⇒ Object

Retrieve signer certificates

Parameters

id(String)

Serialized identity of signer, ignored

Return

(Array)

Signer certificates



52
53
54
# File 'lib/right_agent/security/static_certificate_store.rb', line 52

def get_signer(id)
  @signer_certs
end