instance method
OpenSSL::PKey::EC#public_key=
(::OpenSSL::bn priv_key) -> self
key.public_key = ec_point
ext/openssl/ossl_pkey_ec.c
View on GitHub ↗
static VALUE ossl_ec_key_set_public_key(VALUE self, VALUE public_key)
{
#ifdef OSSL_HAVE_IMMUTABLE_PKEY
rb_raise(ePKeyError, "pkeys are immutable on OpenSSL 3.0");
#else
EC_KEY *ec;
EC_POINT *point = NULL;
GetEC(self, ec);
if (!NIL_P(public_key))
GetECPoint(public_key, point);
switch (EC_KEY_set_public_key(ec, point)) {
case 1:
break;
case 0:
if (point == NULL)
break;
/* fallthrough */
default:
ossl_raise(ePKeyError, "EC_KEY_set_public_key");
}
return public_key;
#endif
}
See the OpenSSL documentation for EC_KEY_set_public_key()