Class: OpenSSL::PKey::EC
- Inherits:
-
Object
- Object
- OpenSSL::PKey::EC
- Defined in:
- lib/openssl/pkey/ec.rb
Overview
Additional helpers for ECDSA keys.
Instance Method Summary collapse
-
#to_spki(format = :uncompressed) ⇒ OpenSSL::X509::SPKI
Generate an OpenSSL::X509::SPKI structure for this public key.
Instance Method Details
#to_spki(format = :uncompressed) ⇒ OpenSSL::X509::SPKI
Generate an OpenSSL::X509::SPKI structure for this public key.
18 19 20 21 22 23 24 |
# File 'lib/openssl/pkey/ec.rb', line 18 def to_spki(format = :uncompressed) unless self.public_key? raise OpenSSL::PKey::ECError, "Cannot convert non-public-key to SPKI" end OpenSSL::X509::SPKI.new("id-ecPublicKey", OpenSSL::ASN1::ObjectId.new(self.public_key.group.curve_name), self.public_key.to_octet_string(format)) end |