ausaccessfed/federationregistry — pull request #154 by vladimir-mencl-eresearch (2014-01-30 04:31:36+00:00)
Title: Scripts: UpdateCAKeyName: handle Email OIDs

Fixes an issue where where one CA was represented with a long string
where the OID representing the email address in a DN
(1.2.840.113549.1.9.1) was not decoded - an even the value was printed
out in hex, resulting into:

1.2.840.113549.1.9.1=#16197072656d69756d2d736572766572407468617774652e636f6d,CN=Thawte
Premium Server CA,OU=Certification Services Division,O=Thawte Consulting
cc,L=Cape Town,ST=Western Cape,C=ZA

Surprisingly, while c.getSubjectDN() nicely decodes the OID and the
value, getSubjectX500Principal().getName() does not.

As the c.getSubjectDN() method is deprecated ("denigrated"), we have to
use getSubjectX500Principal(). A suitable way forward is to use the
getName(String format, Map oidMap) method and provide an
oidMap (using the newer format RFC2253 as the format)