Class: Keystores::Jks::EncryptedPrivateKeyInfo
- Inherits:
-
Object
- Object
- Keystores::Jks::EncryptedPrivateKeyInfo
- Defined in:
- lib/keystores/jks/encrypted_private_key_info.rb
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#encoded ⇒ Object
Returns the value of attribute encoded.
-
#encrypted_data ⇒ Object
Returns the value of attribute encrypted_data.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ EncryptedPrivateKeyInfo
constructor
You can pass either an ASN.1 encryptedPrivateKeyInfo object or the encrypted bytes and the encryption algorithm.
Constructor Details
#initialize(opts = {}) ⇒ EncryptedPrivateKeyInfo
You can pass either an ASN.1 encryptedPrivateKeyInfo object or the encrypted bytes and the encryption algorithm.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/keystores/jks/encrypted_private_key_info.rb', line 23 def initialize(opts = {}) # Parses from encoded private key if opts.has_key?(:encoded) encoded = opts[:encoded] @asn1 = OpenSSL::ASN1.decode(encoded) @encrypted_data = @asn1.value[1].value @algorithm = @asn1.value[0].value[0].value @encoded = encoded else @algorithm = opts[:algorithm] @encrypted_data = opts[:encrypted_data] @encoded = encode(@algorithm, @encrypted_data) end end |
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
14 15 16 |
# File 'lib/keystores/jks/encrypted_private_key_info.rb', line 14 def algorithm @algorithm end |
#encoded ⇒ Object
Returns the value of attribute encoded.
14 15 16 |
# File 'lib/keystores/jks/encrypted_private_key_info.rb', line 14 def encoded @encoded end |
#encrypted_data ⇒ Object
Returns the value of attribute encrypted_data.
14 15 16 |
# File 'lib/keystores/jks/encrypted_private_key_info.rb', line 14 def encrypted_data @encrypted_data end |