OpenSSL::PKey::EC
Inherits OpenSSL::PKey::PKey < Reference < Object
Constructors
new(key : String)
Sourcenew(io : IO)
Sourcenew(size : Int32)
SourceClass methods
from_private_bytes(bytes : Bytes, curve : String = "P-256")
Create EC key from raw private key bytes For P-256, expects 32 bytes; for P-384, expects 48 bytes, etc.
from_public_bytes(bytes : Bytes, curve : String = "P-256")
Create public key from raw bytes (uncompressed format: 0x04 + x + y)
generate(size : Int32)
Sourcegenerate(type : String)
Sourcegenerate_by_curve_name(curve_name : String)
Generate EC key by curve name (supports non-NIST curves like secp256k1)
Instance methods
ec_sign(data)
Sourceec_verify(digest, signature)
Sourcegroup
Sourcegroup_degree
Sourcepublic_key
Sourceto_der(io)
Sourceto_pem(io)
Sourceto_text
Source