instance method
OpenSSL::X509::Name#to_s
(?::OpenSSL::X509::Name::format format) -> ::String
name.to_s → string
name.to_s(format) → string
ext/openssl/ossl_x509name.c
View on GitHub ↗
static VALUE
ossl_x509name_to_s(int argc, VALUE *argv, VALUE self)
{
rb_check_arity(argc, 0, 1);
/* name.to_s(nil) was allowed */
if (!argc || NIL_P(argv[0]))
return ossl_x509name_to_s_old(self);
else
return x509name_print(self, NUM2ULONG(argv[0]));
}
Returns a String representation of the Distinguished Name. format is one of:
If format is omitted, the largely broken and traditional OpenSSL format (X509_NAME_oneline() format) is chosen.
Use of this method is discouraged. None of the formats other than OpenSSL::X509::Name::RFC2253 is standardized and may show an inconsistent behavior through OpenSSL versions.
It is recommended to use to_utf8 instead, which is equivalent to calling name.to_s(OpenSSL::X509::Name::RFC2253).force_encoding("UTF-8").