Package org.bouncycastle.asn1.x500.style
Class BCStyle
java.lang.Object
org.bouncycastle.asn1.x500.style.BCStyle
- All Implemented Interfaces:
X500NameStyle
- Direct Known Subclasses:
BCStrictStyle
public class BCStyle extends Object implements X500NameStyle
-
Field Summary
Fields Modifier and Type Field Description static ASN1ObjectIdentifierBUSINESS_CATEGORYbusinessCategory - DirectoryString(SIZE(1..128)static ASN1ObjectIdentifierCcountry code - StringType(SIZE(2))static ASN1ObjectIdentifierCNcommon name - StringType(SIZE(1..64))static ASN1ObjectIdentifierCOUNTRY_OF_CITIZENSHIPRFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes onlystatic ASN1ObjectIdentifierCOUNTRY_OF_RESIDENCERFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes onlystatic ASN1ObjectIdentifierDATE_OF_BIRTHRFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Zstatic ASN1ObjectIdentifierDCstatic ASN1ObjectIdentifierDMD_NAMERFC 2256 dmdNamestatic ASN1ObjectIdentifierDN_QUALIFIERdnQualifier - DirectoryString(SIZE(1..64)static ASN1ObjectIdentifierEemail address in Verisign certificatesstatic ASN1ObjectIdentifierEmailAddressEmail address (RSA PKCS#9 extension) - IA5String.static ASN1ObjectIdentifierGENDERRFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f"static ASN1ObjectIdentifierGENERATIONstatic ASN1ObjectIdentifierGIVENNAMEstatic ASN1ObjectIdentifierINITIALSstatic X500NameStyleINSTANCEstatic ASN1ObjectIdentifierLlocality name - StringType(SIZE(1..64))static ASN1ObjectIdentifierNAMEid-at-namestatic ASN1ObjectIdentifierNAME_AT_BIRTHISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64)static ASN1ObjectIdentifierOorganization - StringType(SIZE(1..64))static ASN1ObjectIdentifierOUorganizational unit name - StringType(SIZE(1..64))static ASN1ObjectIdentifierPLACE_OF_BIRTHRFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128)static ASN1ObjectIdentifierPOSTAL_ADDRESSRFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30))static ASN1ObjectIdentifierPOSTAL_CODEpostalCode - DirectoryString(SIZE(1..40)static ASN1ObjectIdentifierPSEUDONYMRFC 3039 Pseudonym - DirectoryString(SIZE(1..64)static ASN1ObjectIdentifierSERIALNUMBERdevice serial number name - StringType(SIZE(1..64))static ASN1ObjectIdentifierSNdevice serial number name - StringType(SIZE(1..64))static ASN1ObjectIdentifierSTstate, or province name - StringType(SIZE(1..64))static ASN1ObjectIdentifierSTREETstreet - StringType(SIZE(1..64))static ASN1ObjectIdentifierSURNAMENaming attributes of type X520namestatic ASN1ObjectIdentifierTTitlestatic ASN1ObjectIdentifierTELEPHONE_NUMBERid-at-telephoneNumberstatic ASN1ObjectIdentifierUIDLDAP User id.static ASN1ObjectIdentifierUNIQUE_IDENTIFIERstatic ASN1ObjectIdentifierUnstructuredAddressstatic ASN1ObjectIdentifierUnstructuredNamemore from PKCS#9 -
Constructor Summary
Constructors Modifier Constructor Description protectedBCStyle() -
Method Summary
Modifier and Type Method Description booleanareEqual(X500Name name1, X500Name name2)Return true if the two names are equal.ASN1ObjectIdentifierattrNameToOID(String attrName)Return the OID associated with the passed in name.intcalculateHashCode(X500Name name)Calculate a hashCode for the passed in name.RDN[]fromString(String dirName)Return an array of RDN generated from the passed in String.String[]oidToAttrNames(ASN1ObjectIdentifier oid)Return the acceptable names in a String DN that map to OID.StringoidToDisplayName(ASN1ObjectIdentifier oid)Return the display name for toString() associated with the OID.protected booleanrdnAreEqual(RDN rdn1, RDN rdn2)ASN1EncodablestringToValue(ASN1ObjectIdentifier oid, String value)Convert the passed in String value into the appropriate ASN.1 encoded object.StringtoString(X500Name name)Convert the passed in X500Name to a String.
-
Field Details
-
INSTANCE
-
C
country code - StringType(SIZE(2)) -
O
organization - StringType(SIZE(1..64)) -
OU
organizational unit name - StringType(SIZE(1..64)) -
T
Title -
CN
common name - StringType(SIZE(1..64)) -
SN
device serial number name - StringType(SIZE(1..64)) -
STREET
street - StringType(SIZE(1..64)) -
SERIALNUMBER
device serial number name - StringType(SIZE(1..64)) -
L
locality name - StringType(SIZE(1..64)) -
ST
state, or province name - StringType(SIZE(1..64)) -
SURNAME
Naming attributes of type X520name -
GIVENNAME
-
INITIALS
-
GENERATION
-
UNIQUE_IDENTIFIER
-
BUSINESS_CATEGORY
businessCategory - DirectoryString(SIZE(1..128) -
POSTAL_CODE
postalCode - DirectoryString(SIZE(1..40) -
DN_QUALIFIER
dnQualifier - DirectoryString(SIZE(1..64) -
PSEUDONYM
RFC 3039 Pseudonym - DirectoryString(SIZE(1..64) -
DATE_OF_BIRTH
RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z -
PLACE_OF_BIRTH
RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128) -
GENDER
RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f" -
COUNTRY_OF_CITIZENSHIP
RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes only -
COUNTRY_OF_RESIDENCE
RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes only -
NAME_AT_BIRTH
ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64) -
POSTAL_ADDRESS
RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30)) -
DMD_NAME
RFC 2256 dmdName -
TELEPHONE_NUMBER
id-at-telephoneNumber -
NAME
id-at-name -
EmailAddress
Email address (RSA PKCS#9 extension) - IA5String.Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.
-
UnstructuredName
more from PKCS#9 -
UnstructuredAddress
-
E
email address in Verisign certificates -
DC
-
UID
LDAP User id.
-
-
Constructor Details
-
BCStyle
protected BCStyle()
-
-
Method Details
-
stringToValue
Description copied from interface:X500NameStyleConvert the passed in String value into the appropriate ASN.1 encoded object.- Specified by:
stringToValuein interfaceX500NameStyle- Parameters:
oid- the OID associated with the value in the DN.value- the value of the particular DN component.- Returns:
- the ASN.1 equivalent for the value.
-
oidToDisplayName
Description copied from interface:X500NameStyleReturn the display name for toString() associated with the OID.- Specified by:
oidToDisplayNamein interfaceX500NameStyle- Parameters:
oid- the OID of interest.- Returns:
- the name displayed in toString(), null if no mapping provided.
-
oidToAttrNames
Description copied from interface:X500NameStyleReturn the acceptable names in a String DN that map to OID.- Specified by:
oidToAttrNamesin interfaceX500NameStyle- Parameters:
oid- the OID of interest.- Returns:
- an array of String aliases for the OID, zero length if there are none.
-
attrNameToOID
Description copied from interface:X500NameStyleReturn the OID associated with the passed in name.- Specified by:
attrNameToOIDin interfaceX500NameStyle- Parameters:
attrName- the string to match.- Returns:
- an OID
-
areEqual
Description copied from interface:X500NameStyleReturn true if the two names are equal.- Specified by:
areEqualin interfaceX500NameStyle- Parameters:
name1- first name for comparison.name2- second name for comparison.- Returns:
- true if name1 = name 2, false otherwise.
-
rdnAreEqual
-
fromString
Description copied from interface:X500NameStyleReturn an array of RDN generated from the passed in String.- Specified by:
fromStringin interfaceX500NameStyle- Parameters:
dirName- the String representation.- Returns:
- an array of corresponding RDNs.
-
calculateHashCode
Description copied from interface:X500NameStyleCalculate a hashCode for the passed in name.- Specified by:
calculateHashCodein interfaceX500NameStyle- Parameters:
name- the name the hashCode is required for.- Returns:
- the calculated hashCode.
-
toString
Description copied from interface:X500NameStyleConvert the passed in X500Name to a String.- Specified by:
toStringin interfaceX500NameStyle- Parameters:
name- the name to convert.- Returns:
- a String representation.
-