public class JavaAndBCStyle
extends org.bouncycastle.asn1.x500.style.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 |
---|---|
private static java.util.Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> |
asn2String
Only mappings which are supported by the JDK impl (see sun.security.x509.AVA class).
|
static java.util.Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> |
asn2StringAll
All mappings which are supported by the JDK impl (see sun.security.x509.AVA class).
|
static JavaAndBCStyle |
INSTANCE |
static org.bouncycastle.asn1.ASN1ObjectIdentifier |
IP |
private static java.util.Map<java.lang.String,org.bouncycastle.asn1.ASN1ObjectIdentifier> |
string2Asn
Mappings which are supported by JDK
|
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, ORGANIZATION_IDENTIFIER, 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 |
---|---|
org.bouncycastle.asn1.ASN1ObjectIdentifier |
attrNameToOID(java.lang.String attrName) |
org.bouncycastle.asn1.x500.RDN[] |
fromString(java.lang.String dirName) |
java.lang.String |
getLabelForOid(org.bouncycastle.asn1.ASN1ObjectIdentifier oid) |
java.lang.String |
getLabelForOidFull(org.bouncycastle.asn1.ASN1ObjectIdentifier oid) |
java.lang.String |
toString(org.bouncycastle.asn1.x500.X500Name name) |
java.lang.String |
toString(org.bouncycastle.asn1.x500.X500Name name,
java.util.Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> mappings) |
java.lang.String |
toStringFull(org.bouncycastle.asn1.x500.X500Name name) |
encodeStringValue, oidToAttrNames, oidToDisplayName
private static final java.util.Map<java.lang.String,org.bouncycastle.asn1.ASN1ObjectIdentifier> string2Asn
private static final java.util.Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> asn2String
public static final java.util.Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> asn2StringAll
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier IP
public static final JavaAndBCStyle INSTANCE
public org.bouncycastle.asn1.ASN1ObjectIdentifier attrNameToOID(java.lang.String attrName)
attrNameToOID
in interface org.bouncycastle.asn1.x500.X500NameStyle
attrNameToOID
in class org.bouncycastle.asn1.x500.style.BCStyle
public java.lang.String toString(org.bouncycastle.asn1.x500.X500Name name, java.util.Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> mappings)
public org.bouncycastle.asn1.x500.RDN[] fromString(java.lang.String dirName)
fromString
in interface org.bouncycastle.asn1.x500.X500NameStyle
fromString
in class org.bouncycastle.asn1.x500.style.BCStyle
public java.lang.String toString(org.bouncycastle.asn1.x500.X500Name name)
toString
in interface org.bouncycastle.asn1.x500.X500NameStyle
toString
in class org.bouncycastle.asn1.x500.style.BCStyle
name
- namepublic java.lang.String toStringFull(org.bouncycastle.asn1.x500.X500Name name)
name
- namepublic java.lang.String getLabelForOid(org.bouncycastle.asn1.ASN1ObjectIdentifier oid)
oid
- oidpublic java.lang.String getLabelForOidFull(org.bouncycastle.asn1.ASN1ObjectIdentifier oid)
oid
- oid