123456789_123456789_123456789_123456789_123456789_

Class: OpenSSL::PKey::EC::Group

Relationships & Source Files
Namespace Children
Exceptions:
Inherits: Object
Defined in: ext/openssl/ossl_pkey_ec.c

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(ec_group) .new(pem_or_der_encoded) .new(ec_method) .new(:GFp, bignum_p, bignum_a, bignum_b) .new(:GF2m, bignum_p, bignum_a, bignum_b)

Creates a new Group object.

ec_method is a symbol that represents an EC_METHOD. Currently the following are supported:

  • :GFp_simple

  • :GFp_mont

  • :GFp_nist

  • :GF2m_simple

If the first argument is :GFp or :GF2m, creates a new curve with given parameters.

Instance Attribute Details

#asn1_flagInteger (rw)

Returns the flags set on the group.

See also #asn1_flag=.

#asn1_flag=(flags) (rw)

Sets flags on the group. The flag value is used to determine how to encode the group: encode explicit parameters or named curve using an OID.

The flag value can be either of:

See the ::OpenSSL documentation for EC_GROUP_set_asn1_flag().

#point_conversion_formSymbol (rw)

Returns the form how Point data is encoded as ASN.1.

See also #point_conversion_form=.

#point_conversion_form=(form) (rw)

Sets the form how Point data is encoded as ASN.1 as defined in X9.62.

format can be one of these:

:compressed

Encoded as z||x, where z is an octet indicating which solution of the equation y is. z will be 0x02 or 0x03.

:uncompressed

Encoded as z||x||y, where z is an octet 0x04.

:hybrid

Encodes as z||x||y, where z is an octet indicating which solution of the equation y is. z will be 0x06 or 0x07.

See the ::OpenSSL documentation for EC_GROUP_set_point_conversion_form()

#seedString? (rw)

See the ::OpenSSL documentation for EC_GROUP_get0_seed()

#seed=(seed) ⇒ seed (rw)

See the ::OpenSSL documentation for EC_GROUP_set_seed()

Instance Method Details

#eql?(group2) ⇒ Boolean #==(group2) ⇒ Boolean
Also known as: #eql?

Returns true if the two groups use the same curve and have the same parameters, false otherwise.

#get_cofactorcofactor_bn

Returns the cofactor of the group.

See the ::OpenSSL documentation for EC_GROUP_get_cofactor()

#curve_nameString

Returns the curve name (sn).

See the ::OpenSSL documentation for EC_GROUP_get_curve_name()

#degreeInteger

See the ::OpenSSL documentation for EC_GROUP_get_degree()

#eql?(group2) ⇒ Boolean #==(group2) ⇒ Boolean

Alias for #==.

#generatorec_point

Returns the generator of the group.

See the ::OpenSSL documentation for EC_GROUP_get0_generator()

#get_orderorder_bn

Returns the order of the group.

See the ::OpenSSL documentation for EC_GROUP_get_order()

#set_generator(generator, order, cofactor) ⇒ self

Sets the curve parameters. #generator must be an instance of Point that is on the curve. #order and #cofactor are integers.

See the ::OpenSSL documentation for EC_GROUP_set_generator()