Class: Mallory::SSL::MemoryStorage
- Inherits:
-
Object
- Object
- Mallory::SSL::MemoryStorage
- Defined in:
- lib/mallory/ssl/memory_storage.rb
Instance Method Summary collapse
- #get(domain) ⇒ Object
-
#initialize ⇒ MemoryStorage
constructor
A new instance of MemoryStorage.
- #put(cert) ⇒ Object
Constructor Details
#initialize ⇒ MemoryStorage
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 |