From d4a80dbe52158f204e78afea742fc3322bbc65e5 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 6 Mar 2012 15:53:07 -0500 Subject: Display serial number as HEX (DECIMAL) when showing certificates. https://fedorahosted.org/freeipa/ticket/1991 --- ipalib/plugins/service.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ipalib/plugins/service.py') diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py index 71e4ac46..e75d71f0 100644 --- a/ipalib/plugins/service.py +++ b/ipalib/plugins/service.py @@ -96,6 +96,9 @@ output_params = ( Str('serial_number', label=_('Serial Number'), ), + Str('serial_number_hex', + label=_('Serial Number (hex)'), + ), Str('issuer', label=_('Issuer'), ), @@ -190,6 +193,7 @@ def set_certificate_attrs(entry_attrs): cert = x509.load_certificate(cert, datatype=x509.DER) entry_attrs['subject'] = unicode(cert.subject) entry_attrs['serial_number'] = unicode(cert.serial_number) + entry_attrs['serial_number_hex'] = u'0x%X' % cert.serial_number entry_attrs['issuer'] = unicode(cert.issuer) entry_attrs['valid_not_before'] = unicode(cert.valid_not_before_str) entry_attrs['valid_not_after'] = unicode(cert.valid_not_after_str) -- cgit