instance method
OpenSSL::PKey::DH#private?
() -> bool
dh.private? → true | false
ext/openssl/ossl_pkey_dh.c
View on GitHub ↗
static VALUE
ossl_dh_is_private(VALUE self)
{
OSSL_3_const DH *dh;
const BIGNUM *bn;
GetDH(self, dh);
DH_get0_key(dh, NULL, &bn);
#if !defined(OPENSSL_NO_ENGINE)
return (bn || DH_get0_engine((DH *)dh)) ? Qtrue : Qfalse;
#else
return bn ? Qtrue : Qfalse;
#endif
}
Indicates whether this DH instance has a private key associated with it or not. The private key may be retrieved with DH#priv_key.