diff options
Diffstat (limited to 'sm/certdump.c')
-rw-r--r-- | sm/certdump.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sm/certdump.c b/sm/certdump.c index 0d5146abc..2f7c1fd54 100644 --- a/sm/certdump.c +++ b/sm/certdump.c @@ -238,6 +238,36 @@ gpgsm_dump_cert (const char *text, ksba_cert_t cert) } +/* Log the certificate's name in "#SN/ISSUERDN" format along with + TEXT. */ +void +gpgsm_cert_log_name (const char *text, ksba_cert_t cert) +{ + log_info ("%s", text? text:"certificate" ); + if (cert) + { + ksba_sexp_t sn; + char *p; + + p = ksba_cert_get_issuer (cert, 0); + sn = ksba_cert_get_serial (cert); + if (p && sn) + { + log_printf (" #"); + gpgsm_dump_serial (sn); + log_printf ("/"); + gpgsm_dump_string (p); + } + else + log_printf (" [invalid]"); + ksba_free (sn); + xfree (p); + } + log_printf ("\n"); +} + + + /* helper for the rfc2253 string parser */ static const unsigned char * |