instance method
OpenSSL::PKey::EC#group=
(::OpenSSL::PKey::EC::Group) -> ::OpenSSL::PKey::EC::Group
key.group = group
ext/openssl/ossl_pkey_ec.c
View on GitHub ↗
static VALUE
ossl_ec_key_set_group(VALUE self, VALUE group_v)
{
#ifdef OSSL_HAVE_IMMUTABLE_PKEY
rb_raise(ePKeyError, "pkeys are immutable on OpenSSL 3.0");
#else
EC_KEY *ec;
EC_GROUP *group;
GetEC(self, ec);
GetECGroup(group_v, group);
if (EC_KEY_set_group(ec, group) != 1)
ossl_raise(ePKeyError, "EC_KEY_set_group");
return group_v;
#endif
}
Sets the EC::Group for the key. The group structure is internally copied so modification to group after assigning to a key has no effect on the key.