Open rhenium opened 3 months ago
The returned Hash from these methods contain 0 in place of a missing parameter in the key, for example:
pkey = OpenSSL::PKey.read(OpenSSL::PKey::RSA.new(2048).public_to_pem) pp pkey.params #=> # {"n"=>#<OpenSSL::BN 286934673421[...snip]>, # "e"=>#<OpenSSL::BN 65537>, # "d"=>#<OpenSSL::BN 0>, # "p"=>#<OpenSSL::BN 0>, # "q"=>#<OpenSSL::BN 0>, # "dmp1"=>#<OpenSSL::BN 0>, # "dmq1"=>#<OpenSSL::BN 0>, # "iqmp"=>#<OpenSSL::BN 0>}
Let's use nil instead, which is more appropriate for indicating a missing value.
Also:
pkey: implement PKey::{RSA,DSA,DH}#params in Ruby
Move the definitions to lib/openssl/pkey.rb.
They don't have to be implemented in the native extension and can be simplified by using existing methods.
The returned Hash from these methods contain 0 in place of a missing parameter in the key, for example:
Let's use nil instead, which is more appropriate for indicating a missing value.
Also:
pkey: implement PKey::{RSA,DSA,DH}#params in Ruby
Move the definitions to lib/openssl/pkey.rb.
They don't have to be implemented in the native extension and can be simplified by using existing methods.