Class: Jpdfer::KeyStore
- Inherits:
-
Object
- Object
- Jpdfer::KeyStore
- Defined in:
- lib/jpdfer/key_store.rb
Constant Summary collapse
- JavaFileInputStream =
java.io.FileInputStream
- JavaKeyStore =
java.security.KeyStore
- JavaString =
java.lang.String
Instance Method Summary collapse
- #certificate_chain ⇒ Object
-
#initialize(keystore_path, _alias, password) ⇒ KeyStore
constructor
A new instance of KeyStore.
- #private_key ⇒ Object
Constructor Details
#initialize(keystore_path, _alias, password) ⇒ KeyStore
Returns a new instance of KeyStore.
8 9 10 11 12 |
# File 'lib/jpdfer/key_store.rb', line 8 def initialize(keystore_path, _alias, password) @alias, @password = _alias, password @keystore = JavaKeyStore::getInstance(JavaKeyStore::getDefaultType()) @keystore.load(JavaFileInputStream.new(keystore_path), JavaString.new(@password).toCharArray) end |
Instance Method Details
#certificate_chain ⇒ Object
18 19 20 |
# File 'lib/jpdfer/key_store.rb', line 18 def certificate_chain @keystore.getCertificateChain(@alias) end |
#private_key ⇒ Object
14 15 16 |
# File 'lib/jpdfer/key_store.rb', line 14 def private_key @keystore.getKey(@alias, java.lang.String.new(@password).toCharArray) end |