Class: Mallory::SSL::MemoryStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/mallory/ssl/memory_storage.rb

Instance Method Summary collapse

Constructor Details

#initializeMemoryStorage

Returns a new instance of MemoryStorage.



5
6
7
# File 'lib/mallory/ssl/memory_storage.rb', line 5

def initialize
  @certs = {}
end

Instance Method Details

#get(domain) ⇒ Object



9
10
11
# File 'lib/mallory/ssl/memory_storage.rb', line 9

def get domain
  @certs[domain]
end

#put(cert) ⇒ Object



13
14
15
16
# File 'lib/mallory/ssl/memory_storage.rb', line 13

def put cert
  domain = cert.subject.to_a.select{|x|x[0]=="CN"}.first[1] #OpenSSL::X509::Name could have hash interface. Could.
  @certs[domain] = cert
end