Class: OpenSSL::SignatureAlgorithm::ECDSA::VerifyKey
- Inherits:
-
PKey::EC::Point
- Object
- PKey::EC::Point
- OpenSSL::SignatureAlgorithm::ECDSA::VerifyKey
- Defined in:
- lib/openssl/signature_algorithm/ecdsa.rb
Class Method Summary collapse
Instance Method Summary collapse
- #ec_key ⇒ Object
-
#initialize(*args) ⇒ VerifyKey
constructor
A new instance of VerifyKey.
- #serialize ⇒ Object
- #verify(*args) ⇒ Object
Constructor Details
Class Method Details
.deserialize(pem_string) ⇒ Object
27 28 29 |
# File 'lib/openssl/signature_algorithm/ecdsa.rb', line 27 def self.deserialize(pem_string) new(OpenSSL::PKey::EC.new(pem_string).public_key) end |
Instance Method Details
#ec_key ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/openssl/signature_algorithm/ecdsa.rb', line 35 def ec_key @ec_key ||= begin # RFC5480 SubjectPublicKeyInfo asn1 = OpenSSL::ASN1::Sequence( [ OpenSSL::ASN1::Sequence( [ OpenSSL::ASN1::ObjectId("id-ecPublicKey"), OpenSSL::ASN1::ObjectId(group.curve_name), ] ), OpenSSL::ASN1::BitString(to_octet_string(:uncompressed)) ] ) OpenSSL::PKey::EC.new(asn1.to_der) end end |
#serialize ⇒ Object
31 32 33 |
# File 'lib/openssl/signature_algorithm/ecdsa.rb', line 31 def serialize ec_key.to_pem end |
#verify(*args) ⇒ Object
55 56 57 |
# File 'lib/openssl/signature_algorithm/ecdsa.rb', line 55 def verify(*args) ec_key.verify(*args) end |