Class: Keystores::Keystore
- Inherits:
-
Object
- Object
- Keystores::Keystore
- Defined in:
- lib/keystores/keystore.rb
Direct Known Subclasses
Constant Summary collapse
- @@registry =
{}
Class Method Summary collapse
-
.get_instance(key_store_algorithm) ⇒ Object
Get an instance of a key store, given a key store algorithm string.
-
.register_algorithm(algorithm, clazz) ⇒ Object
Register your key store algorithm.
Instance Method Summary collapse
-
#aliases ⇒ Object
Lists all the alias names of this keystore.
-
#contains_alias(aliaz) ⇒ Object
Checks if the given alias exists in this keystore.
-
#delete_entry(aliaz) ⇒ Object
Deletes the entry identified by the given alias from this keystore.
-
#get_certificate(aliaz) ⇒ Object
Returns the certificate associated with the given alias.
-
#get_certificate_alias(certificate) ⇒ Object
Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.
-
#get_certificate_chain(aliaz) ⇒ Object
Returns the certificate chain associated with the given alias.
-
#get_key(aliaz, password) ⇒ Object
Returns the key associated with the given alias, using the given password to recover it.
-
#get_type ⇒ Object
Returns the type of this keystore.
-
#is_certificate_entry(aliaz) ⇒ Object
Returns true if the entry identified by the given alias was created by a call to #set_certificate_entry.
-
#is_key_entry(aliaz) ⇒ Object
Returns true if the entry identified by the given alias was created by a call to #set_key_entry.
-
#load(key_store_file, password) ⇒ Object
Loads this Keystore from the given path.
-
#set_certificate_entry(aliaz, certificate) ⇒ Object
Assigns the given trusted certificate to the given alias.
-
#set_key_entry(aliaz, key, certificate_chain, password = nil) ⇒ Object
Assigns the given key to the given alias.
-
#size ⇒ Object
Retrieves the number of entries in this keystore.
-
#store(key_store_file, password) ⇒ Object
Stores this keystore to the given path, and protects its integrity with the given password.
Class Method Details
.get_instance(key_store_algorithm) ⇒ Object
Get an instance of a key store, given a key store algorithm string
7 8 9 |
# File 'lib/keystores/keystore.rb', line 7 def self.get_instance(key_store_algorithm) @@registry[key_store_algorithm].new end |
.register_algorithm(algorithm, clazz) ⇒ Object
Register your key store algorithm
12 13 14 |
# File 'lib/keystores/keystore.rb', line 12 def self.register_algorithm(algorithm, clazz) @@registry[algorithm] = clazz end |
Instance Method Details
#aliases ⇒ Object
Lists all the alias names of this keystore.
17 18 19 |
# File 'lib/keystores/keystore.rb', line 17 def aliases end |
#contains_alias(aliaz) ⇒ Object
Checks if the given alias exists in this keystore.
22 23 24 |
# File 'lib/keystores/keystore.rb', line 22 def contains_alias(aliaz) end |
#delete_entry(aliaz) ⇒ Object
Deletes the entry identified by the given alias from this keystore.
27 28 29 |
# File 'lib/keystores/keystore.rb', line 27 def delete_entry(aliaz) end |
#get_certificate(aliaz) ⇒ Object
Returns the certificate associated with the given alias.
32 33 34 |
# File 'lib/keystores/keystore.rb', line 32 def get_certificate(aliaz) end |
#get_certificate_alias(certificate) ⇒ Object
Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.
37 38 39 |
# File 'lib/keystores/keystore.rb', line 37 def get_certificate_alias(certificate) end |
#get_certificate_chain(aliaz) ⇒ Object
Returns the certificate chain associated with the given alias.
42 43 44 |
# File 'lib/keystores/keystore.rb', line 42 def get_certificate_chain(aliaz) end |
#get_key(aliaz, password) ⇒ Object
Returns the key associated with the given alias, using the given password to recover it.
47 48 49 |
# File 'lib/keystores/keystore.rb', line 47 def get_key(aliaz, password) end |
#get_type ⇒ Object
Returns the type of this keystore.
52 53 54 |
# File 'lib/keystores/keystore.rb', line 52 def get_type end |
#is_certificate_entry(aliaz) ⇒ Object
Returns true if the entry identified by the given alias was created by a call to #set_certificate_entry
57 58 59 |
# File 'lib/keystores/keystore.rb', line 57 def is_certificate_entry(aliaz) end |
#is_key_entry(aliaz) ⇒ Object
Returns true if the entry identified by the given alias was created by a call to #set_key_entry
62 63 64 |
# File 'lib/keystores/keystore.rb', line 62 def is_key_entry(aliaz) end |
#load(key_store_file, password) ⇒ Object
Loads this Keystore from the given path.
67 68 69 |
# File 'lib/keystores/keystore.rb', line 67 def load(key_store_file, password) end |
#set_certificate_entry(aliaz, certificate) ⇒ Object
Assigns the given trusted certificate to the given alias.
77 78 79 |
# File 'lib/keystores/keystore.rb', line 77 def set_certificate_entry(aliaz, certificate) end |
#set_key_entry(aliaz, key, certificate_chain, password = nil) ⇒ Object
Assigns the given key to the given alias. If password is nil, it is assumed that the key is already protected
82 83 84 |
# File 'lib/keystores/keystore.rb', line 82 def set_key_entry(aliaz, key, certificate_chain, password = nil) end |
#size ⇒ Object
Retrieves the number of entries in this keystore.
87 88 89 |
# File 'lib/keystores/keystore.rb', line 87 def size end |
#store(key_store_file, password) ⇒ Object
Stores this keystore to the given path, and protects its integrity with the given password.
72 73 74 |
# File 'lib/keystores/keystore.rb', line 72 def store(key_store_file, password) end |