class method
OpenSSL::PKey.generate_parameters
OpenSSL::PKey.generate_parameters(algo_name [, options]) → pkey
ext/openssl/ossl_pkey.c
View on GitHub ↗
static VALUE
ossl_pkey_s_generate_parameters(int argc, VALUE *argv, VALUE self)
{
return pkey_generate(argc, argv, self, 1);
}
Generates new parameters for the algorithm. algo_name is a String that represents the algorithm. The optional argument options is a Hash that specifies the options specific to the algorithm. The order of the options can be important.
A block can be passed optionally. The meaning of the arguments passed to the block varies depending on the implementation of the algorithm. The block may be called once or multiple times, or may not even be called.
For the supported options, see the documentation for the ‘openssl genpkey’ utility command.
Example
Example
pkey = OpenSSL::PKey.generate_parameters("DSA", "dsa_paramgen_bits" => 2048) p pkey.p.num_bits #=> 2048