instance method
OpenSSL::Netscape::SPKI#sign
(::OpenSSL::PKey::PKey key, ::OpenSSL::Digest digest) -> self
spki.sign(key, digest) => spki
ext/openssl/ossl_ns_spki.c
View on GitHub ↗
static VALUE
ossl_spki_sign(VALUE self, VALUE key, VALUE digest)
{
NETSCAPE_SPKI *spki;
EVP_PKEY *pkey;
const EVP_MD *md;
VALUE md_holder;
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
md = ossl_evp_md_fetch(digest, &md_holder);
GetSPKI(self, spki);
if (!NETSCAPE_SPKI_sign(spki, pkey, md))
ossl_raise(eSPKIError, "NETSCAPE_SPKI_sign");
return self;
}
Parameters
-
key - the private key to be used for signing this instance
-
digest - the digest to be used for signing this instance
To sign an SPKI, the private key corresponding to the public key set for this instance should be used, in addition to a digest algorithm in the form of an OpenSSL::Digest. The private key should be an instance of OpenSSL::PKey.