public class JavaAndBCStyle extends BCStyle
BCStyle
with additional recognized attribute names, to make
it fully compatible with what the internal OpenJDK implementation supports
when parsing string RFC 2253 DNs.
The serialization part of this class (toString(X500Name)) behaves in a different way: it only outputs labels for the attribute names which are recognized by JDK. All other are output as OIDs.
Therefore this class allows to consume even unsupported by the JDK DNs, all
supported and convert them to BC RDNs form. On the other hand it allows to
convert RDNs to RFC 2253 form ensuring that this form is acceptable by the
JDK X500Principal
class.
Modifier and Type | Field and Description |
---|---|
static Hashtable<ASN1ObjectIdentifier,String> |
asn2StringAll
All mappings which are supported by the JDK impl (see sun.security.x509.AVA class).
|
static JavaAndBCStyle |
INSTANCE |
static ASN1ObjectIdentifier |
IP |
BUSINESS_CATEGORY, C, CN, COUNTRY_OF_CITIZENSHIP, COUNTRY_OF_RESIDENCE, DATE_OF_BIRTH, DC, defaultLookUp, defaultSymbols, DMD_NAME, DN_QUALIFIER, E, EmailAddress, GENDER, GENERATION, GIVENNAME, INITIALS, L, NAME, NAME_AT_BIRTH, O, OU, PLACE_OF_BIRTH, POSTAL_ADDRESS, POSTAL_CODE, PSEUDONYM, SERIALNUMBER, SN, ST, STREET, SURNAME, T, TELEPHONE_NUMBER, UID, UNIQUE_IDENTIFIER, UnstructuredAddress, UnstructuredName
Constructor and Description |
---|
JavaAndBCStyle() |
Modifier and Type | Method and Description |
---|---|
ASN1ObjectIdentifier |
attrNameToOID(String attrName) |
RDN[] |
fromString(String dirName) |
String |
getLabelForOid(ASN1ObjectIdentifier oid) |
String |
getLabelForOidFull(ASN1ObjectIdentifier oid) |
String |
toString(X500Name name) |
String |
toString(X500Name name,
Hashtable<ASN1ObjectIdentifier,String> mappings) |
String |
toStringFull(X500Name name) |
encodeStringValue, oidToAttrNames, oidToDisplayName
areEqual, calculateHashCode, copyHashTable, rdnAreEqual, stringToValue
public static final Hashtable<ASN1ObjectIdentifier,String> asn2StringAll
public static final ASN1ObjectIdentifier IP
public static final JavaAndBCStyle INSTANCE
public ASN1ObjectIdentifier attrNameToOID(String attrName)
attrNameToOID
in interface X500NameStyle
attrNameToOID
in class BCStyle
public String toString(X500Name name, Hashtable<ASN1ObjectIdentifier,String> mappings)
public RDN[] fromString(String dirName)
fromString
in interface X500NameStyle
fromString
in class BCStyle
public String toString(X500Name name)
toString
in interface X500NameStyle
toString
in class BCStyle
name
- namepublic String toStringFull(X500Name name)
name
- namepublic String getLabelForOid(ASN1ObjectIdentifier oid)
oid
- oidpublic String getLabelForOidFull(ASN1ObjectIdentifier oid)
oid
- oidCopyright © 2012-2017 European Middleware Initiative. All Rights Reserved.