Class: OpenSSL::PKey::EC
- Inherits:
-
Object
- Object
- OpenSSL::PKey::EC
- Defined in:
- lib/openssl/pkey/ec.rb
Instance Method Summary collapse
-
#to_spki(format = :uncompressed) ⇒ Object
Generate an OpenSSL::X509::SPKI structure for this public key.
Instance Method Details
#to_spki(format = :uncompressed) ⇒ Object
Generate an OpenSSL::X509::SPKI structure for this public key
7 8 9 10 11 12 13 |
# File 'lib/openssl/pkey/ec.rb', line 7 def to_spki(format = :uncompressed) unless self.public_key? raise 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 |