Class JavaAndBCStyle
java.lang.Object
org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
org.bouncycastle.asn1.x500.style.BCStyle
eu.emi.security.authn.x509.helpers.JavaAndBCStyle
- All Implemented Interfaces:
org.bouncycastle.asn1.x500.X500NameStyle
public class JavaAndBCStyle
extends org.bouncycastle.asn1.x500.style.BCStyle
Extends
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.
- Author:
- K. Benedyczak
-
Field Summary
FieldsModifier and TypeFieldDescriptionAll mappings which are supported by the JDK impl (see sun.security.x509.AVA class).static final JavaAndBCStyle
static final org.bouncycastle.asn1.ASN1ObjectIdentifier
Fields inherited from class org.bouncycastle.asn1.x500.style.BCStyle
BUSINESS_CATEGORY, C, CN, COUNTRY_OF_CITIZENSHIP, COUNTRY_OF_RESIDENCE, DATE_OF_BIRTH, DC, defaultLookUp, defaultSymbols, DESCRIPTION, 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, ROLE, SERIALNUMBER, SN, ST, STREET, SURNAME, T, TELEPHONE_NUMBER, UID, UNIQUE_IDENTIFIER, UnstructuredAddress, UnstructuredName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.ASN1ObjectIdentifier
attrNameToOID
(String attrName) org.bouncycastle.asn1.x500.RDN[]
fromString
(String dirName) getLabelForOid
(org.bouncycastle.asn1.ASN1ObjectIdentifier oid) getLabelForOidFull
(org.bouncycastle.asn1.ASN1ObjectIdentifier oid) toString
(org.bouncycastle.asn1.x500.X500Name name) toString
(org.bouncycastle.asn1.x500.X500Name name, Hashtable<org.bouncycastle.asn1.ASN1ObjectIdentifier, String> mappings) toStringFull
(org.bouncycastle.asn1.x500.X500Name name) Methods inherited from class org.bouncycastle.asn1.x500.style.BCStyle
encodeStringValue, oidToAttrNames, oidToDisplayName
Methods inherited from class org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
areEqual, calculateHashCode, copyHashTable, rdnAreEqual, stringToValue
-
Field Details
-
asn2StringAll
All mappings which are supported by the JDK impl (see sun.security.x509.AVA class). and the BCStyle. -
IP
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier IP -
INSTANCE
-
-
Constructor Details
-
JavaAndBCStyle
public JavaAndBCStyle()
-
-
Method Details
-
attrNameToOID
- Specified by:
attrNameToOID
in interfaceorg.bouncycastle.asn1.x500.X500NameStyle
- Overrides:
attrNameToOID
in classorg.bouncycastle.asn1.x500.style.BCStyle
-
toString
-
fromString
- Specified by:
fromString
in interfaceorg.bouncycastle.asn1.x500.X500NameStyle
- Overrides:
fromString
in classorg.bouncycastle.asn1.x500.style.BCStyle
-
toString
- Specified by:
toString
in interfaceorg.bouncycastle.asn1.x500.X500NameStyle
- Overrides:
toString
in classorg.bouncycastle.asn1.x500.style.BCStyle
- Parameters:
name
- name- Returns:
- String representation with human readable labels for all attributes known by the JDK.
-
toStringFull
- Parameters:
name
- name- Returns:
- String representation with human readable labels for all known attributes.
-
getLabelForOid
- Parameters:
oid
- oid- Returns:
- String label for the oid if it is known by the JDK
-
getLabelForOidFull
- Parameters:
oid
- oid- Returns:
- String label for the oid if it is among all known attributes
-