Class: EllipticCurve::PublicKey
- Inherits:
-
Object
- Object
- EllipticCurve::PublicKey
- Defined in:
- lib/publickey.rb
Instance Attribute Summary collapse
-
#openSslPublicKey ⇒ Object
readonly
Returns the value of attribute openSslPublicKey.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(openSslPublicKey) ⇒ PublicKey
constructor
A new instance of PublicKey.
- #toDer ⇒ Object
- #toPem ⇒ Object
- #toString ⇒ Object
Constructor Details
#initialize(openSslPublicKey) ⇒ PublicKey
Returns a new instance of PublicKey.
5 6 7 |
# File 'lib/publickey.rb', line 5 def initialize(openSslPublicKey) @openSslPublicKey = openSslPublicKey end |
Instance Attribute Details
#openSslPublicKey ⇒ Object (readonly)
Returns the value of attribute openSslPublicKey.
9 10 11 |
# File 'lib/publickey.rb', line 9 def openSslPublicKey @openSslPublicKey end |
Class Method Details
.fromDer(string) ⇒ Object
27 28 29 |
# File 'lib/publickey.rb', line 27 def self.fromDer(string) return PublicKey.new(OpenSSL::PKey::EC.new(string)) end |
Instance Method Details
#toDer ⇒ Object
15 16 17 |
# File 'lib/publickey.rb', line 15 def toDer @openSslPublicKey.to_der() end |
#toPem ⇒ Object
19 20 21 |
# File 'lib/publickey.rb', line 19 def toPem @openSslPublicKey.to_pem() end |
#toString ⇒ Object
11 12 13 |
# File 'lib/publickey.rb', line 11 def toString return Base64.encode64(self.toDer()) end |