Class: OpenSSL::PKey::EC
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
PKey
|
|
Instance Chain:
self,
PKey
|
|
Inherits: |
OpenSSL::PKey::PKey
|
Defined in: | ext/openssl/ossl_pkey_ec.c |
Constant Summary
-
NAMED_CURVE =
# File 'ext/openssl/ossl_pkey_ec.c', line 1606ULONG2NUM(OPENSSL_EC_NAMED_CURVE)
Class Method Summary
-
.builtin_curves ⇒ Array, comment
See the ::OpenSSL documentation for EC_builtin_curves().
-
.new
constructor
See the ::OpenSSL documentation for:
PKey - Inherited
.new | Because PKey is an abstract class, actually calling this method explicitly will raise a |
Instance Attribute Summary
-
#group ⇒ group
rw
Returns a constant
OpenSSL::EC::Group
that is tied to the key. -
#group=(group) ⇒ group
rw
Returns the same object passed, not the group object associated with the key.
-
#private_key ⇒ OpenSSL::BN
rw
See the ::OpenSSL documentation for EC_KEY_get0_private_key().
-
#private_key=(openssl_bn)
rw
See the ::OpenSSL documentation for EC_KEY_set_private_key().
-
#private_key? ⇒ Boolean
rw
Both public_key? and private_key? may return false at the same time unlike other PKey classes.
-
#public_key ⇒ EC
rw
See the ::OpenSSL documentation for EC_KEY_get0_public_key().
-
#public_key=(ec_point)
rw
See the ::OpenSSL documentation for EC_KEY_set_public_key().
-
#public_key? ⇒ Boolean
rw
Both public_key? and private_key? may return false at the same time unlike other PKey classes.
Instance Method Summary
-
#check_key ⇒ true
Raises an exception if the key is invalid.
-
#dh_compute_key(pubkey) ⇒ String
See the ::OpenSSL documentation for ECDH_compute_key().
-
#dsa_sign_asn1(data) ⇒ String
See the ::OpenSSL documentation for ECDSA_sign().
-
#dsa_verify_asn1(data, sig) ⇒ Boolean
See the ::OpenSSL documentation for ECDSA_verify().
-
#export([cipher, pass_phrase]) ⇒ String
(also: #to_pem)
Outputs the
EC
key in PEM encoding. -
#generate_key ⇒ self
See the ::OpenSSL documentation for EC_KEY_generate_key().
-
#to_der ⇒ String
See the ::OpenSSL documentation for i2d_ECPrivateKey_bio().
-
#to_pem([cipher, pass_phrase]) ⇒ String
Alias for #export.
-
#to_text ⇒ String
See the ::OpenSSL documentation for EC_KEY_print().
PKey - Inherited
#sign | To sign the |
#verify | To verify the |
Constructor Details
.new
.new(ec_key)
.new(ec_group)
.new("secp112r1")
.new(pem_string)
.new(pem_string [, pwd])
.new(der_string)
See the ::OpenSSL documentation for:
EC_KEY_*
Class Method Details
.builtin_curves ⇒ Array
, comment
See the ::OpenSSL documentation for EC_builtin_curves()
Instance Attribute Details
#group ⇒ group (rw)
Returns a constant OpenSSL::EC::Group
that is tied to the key. Modifying the returned group can make the key invalid.
#group=(group) ⇒ group (rw)
Returns the same object passed, not the group object associated with the key. If you wish to access the group object tied to the key call key.group after setting the group.
Setting the group will immediately destroy any previously assigned group object. The group is internally copied by ::OpenSSL. Modifying the original group after assignment will not effect the internal key structure. (your changes may be lost). BE CAREFUL.
EC_KEY_set_group calls EC_GROUP_free(key->group) then EC_GROUP_dup(), not EC_GROUP_copy. This documentation is accurate for ::OpenSSL 0.9.8b.
#private_key ⇒ OpenSSL::BN (rw)
See the ::OpenSSL documentation for EC_KEY_get0_private_key()
#private_key=(openssl_bn) (rw)
See the ::OpenSSL documentation for EC_KEY_set_private_key()
#private_key? ⇒ Boolean
(rw)
Both public_key? and private_key? may return false at the same time unlike other PKey classes.
#public_key ⇒ EC
(rw)
See the ::OpenSSL documentation for EC_KEY_get0_public_key()
#public_key=(ec_point) (rw)
See the ::OpenSSL documentation for EC_KEY_set_public_key()
#public_key? ⇒ Boolean
(rw)
Both public_key? and private_key? may return false at the same time unlike other PKey classes.
Instance Method Details
#check_key ⇒ true
Raises an exception if the key is invalid.
See the ::OpenSSL documentation for EC_KEY_check_key()
#dh_compute_key(pubkey) ⇒ String
See the ::OpenSSL documentation for ECDH_compute_key()
#dsa_sign_asn1(data) ⇒ String
See the ::OpenSSL documentation for ECDSA_sign()
#dsa_verify_asn1(data, sig) ⇒ Boolean
See the ::OpenSSL documentation for ECDSA_verify()
#export([cipher, pass_phrase]) ⇒ String
#to_pem([cipher, pass_phrase]) ⇒ String
Also known as: #to_pem
String
#to_pem([cipher, pass_phrase]) ⇒ String
Outputs the EC
key in PEM encoding. If cipher
and pass_phrase
are given they will be used to encrypt the key. cipher
must be an ::OpenSSL::Cipher::Cipher instance. Note that encryption will only be effective for a private key, public keys will always be encoded in plain text.
#generate_key ⇒ self
See the ::OpenSSL documentation for EC_KEY_generate_key()
#to_der ⇒ String
See the ::OpenSSL documentation for i2d_ECPrivateKey_bio()
#export([cipher, pass_phrase]) ⇒ String
#to_pem([cipher, pass_phrase]) ⇒ String
String
#to_pem([cipher, pass_phrase]) ⇒ String
Alias for #export.
#to_text ⇒ String
See the ::OpenSSL documentation for EC_KEY_print()