method

generate_key!

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: EC
generate_key!() public

Generates a new random private and public key.

See also the OpenSSL documentation for EC_KEY_generate_key()

Example

ec = OpenSSL::PKey::EC.new("prime256v1")
p ec.private_key # => nil
ec.generate_key!
p ec.private_key # => #<OpenSSL::BN XXXXXX>
Show source
Register or log in to add new notes.