Class: Pkernel::Identity
- Inherits:
-
Object
- Object
- Pkernel::Identity
- Defined in:
- lib/pkernel.rb
Overview
Identity Identity is abstraction consist of keypair + certificate, stored separately
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#chain ⇒ Object
readonly
Returns the value of attribute chain.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#keystore ⇒ Object
readonly
Returns the value of attribute keystore.
-
#privKey ⇒ Object
readonly
Returns the value of attribute privKey.
-
#pubKey ⇒ Object
readonly
Returns the value of attribute pubKey.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Identity
constructor
A new instance of Identity.
- #to_s ⇒ Object
Constructor Details
#initialize(opts) ⇒ Identity
Returns a new instance of Identity.
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/pkernel.rb', line 142 def initialize(opts) if self.respond_to?(:pre_init) pre_init(opts) end @key = opts[:key] @pubKey = opts[:pubKey] @privKey = opts[:privKey] @certificate = opts[:certificate] @keystore = opts[:keystore] @chain = opts[:chain] if self.respond_to?(:post_init) post_init(opts) end end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
141 142 143 |
# File 'lib/pkernel.rb', line 141 def certificate @certificate end |
#chain ⇒ Object (readonly)
Returns the value of attribute chain.
141 142 143 |
# File 'lib/pkernel.rb', line 141 def chain @chain end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
141 142 143 |
# File 'lib/pkernel.rb', line 141 def key @key end |
#keystore ⇒ Object (readonly)
Returns the value of attribute keystore.
141 142 143 |
# File 'lib/pkernel.rb', line 141 def keystore @keystore end |
#privKey ⇒ Object (readonly)
Returns the value of attribute privKey.
141 142 143 |
# File 'lib/pkernel.rb', line 141 def privKey @privKey end |
#pubKey ⇒ Object (readonly)
Returns the value of attribute pubKey.
141 142 143 |
# File 'lib/pkernel.rb', line 141 def pubKey @pubKey end |
Instance Method Details
#to_s ⇒ Object
157 158 159 160 161 162 163 |
# File 'lib/pkernel.rb', line 157 def to_s res = [] res << "Identity:" res << "Keypair : #{@key.nil? ? 'Not exist' : 'Exist'}" res << "Cert : #{@certificate.nil? ? 'Not exist' : 'Exist'}" res.join("\n") end |