Flowdock
class

EC

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Superclass: cPKey

OpenSSL::PKey::EC provides access to Elliptic Curve Digital Signature Algorithm (ECDSA) and Elliptic Curve Diffie-Hellman (ECDH).

Key exchange

ec1 = OpenSSL::PKey::EC.generate("prime256v1")
ec2 = OpenSSL::PKey::EC.generate("prime256v1")
# ec1 and ec2 have own private key respectively
shared_key1 = ec1.dh_compute_key(ec2.public_key)
shared_key2 = ec2.dh_compute_key(ec1.public_key)

p shared_key1 == shared_key2 #=> true

Constants

EXPLICIT_CURVE = INT2NUM(OPENSSL_EC_EXPLICIT_CURVE)

NAMED_CURVE = INT2NUM(OPENSSL_EC_NAMED_CURVE)

Attributes

Show files where this class is defined (1 file)
Register or log in to add new notes.