End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OpenSSL::PKey::DSA#to_pem
dsa.to_pem([cipher, password]) → aString
ext/openssl/ossl_pkey_dsa.c
View on GitHub ↗
static VALUE
ossl_dsa_export(int argc, VALUE *argv, VALUE self)
{
DSA *dsa;
GetDSA(self, dsa);
if (DSA_HAS_PRIVATE(dsa))
return ossl_pkey_export_traditional(argc, argv, self, 0);
else
return ossl_pkey_export_spki(self, 0);
}
Alias of #export
Encodes this DSA to its PEM encoding.
Parameters
-
cipher is an
OpenSSL::Cipher. -
password is a string containing your password.
Examples
DSA.to_pem -> aString DSA.to_pem(cipher, 'mypassword') -> aString