Package org.bouncycastle.asn1.x500.style
Class BCStyle
- java.lang.Object
-
- org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
-
- org.bouncycastle.asn1.x500.style.BCStyle
-
- All Implemented Interfaces:
X500NameStyle
- Direct Known Subclasses:
BCStrictStyle
public class BCStyle extends AbstractX500NameStyle
-
-
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 ASN1ObjectIdentifierDCprotected java.util.HashtabledefaultLookUpprotected java.util.HashtabledefaultSymbolsstatic ASN1ObjectIdentifierDESCRIPTIONstatic 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 X500NameStyleINSTANCESingleton instance.static 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 ASN1ObjectIdentifierORGANIZATION_IDENTIFIERid-at-organizationIdentifierstatic 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 ASN1ObjectIdentifierROLEstatic ASN1ObjectIdentifierSERIALNUMBERdevice serial number name - StringType(SIZE(1..64))static ASN1ObjectIdentifierSNDeprecated.use SERIALNUMBER or SURNAMEstatic 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ASN1ObjectIdentifierattrNameToOID(java.lang.String attrName)Return the OID associated with the passed in name.protected ASN1EncodableencodeStringValue(ASN1ObjectIdentifier oid, java.lang.String value)Encoded every value into a UTF8String.RDN[]fromString(java.lang.String dirName)Return an array of RDN generated from the passed in String.java.lang.String[]oidToAttrNames(ASN1ObjectIdentifier oid)Return the acceptable names in a String DN that map to OID.java.lang.StringoidToDisplayName(ASN1ObjectIdentifier oid)Return the display name for toString() associated with the OID.java.lang.StringtoString(X500Name name)Convert the passed in X500Name to a String.-
Methods inherited from class org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
areEqual, calculateHashCode, copyHashTable, rdnAreEqual, stringToValue
-
-
-
-
Field Detail
-
C
public static final ASN1ObjectIdentifier C
country code - StringType(SIZE(2))
-
O
public static final ASN1ObjectIdentifier O
organization - StringType(SIZE(1..64))
-
OU
public static final ASN1ObjectIdentifier OU
organizational unit name - StringType(SIZE(1..64))
-
T
public static final ASN1ObjectIdentifier T
Title
-
CN
public static final ASN1ObjectIdentifier CN
common name - StringType(SIZE(1..64))
-
SN
public static final ASN1ObjectIdentifier SN
Deprecated.use SERIALNUMBER or SURNAMEdevice serial number name - StringType(SIZE(1..64))
-
STREET
public static final ASN1ObjectIdentifier STREET
street - StringType(SIZE(1..64))
-
SERIALNUMBER
public static final ASN1ObjectIdentifier SERIALNUMBER
device serial number name - StringType(SIZE(1..64))
-
L
public static final ASN1ObjectIdentifier L
locality name - StringType(SIZE(1..64))
-
ST
public static final ASN1ObjectIdentifier ST
state, or province name - StringType(SIZE(1..64))
-
SURNAME
public static final ASN1ObjectIdentifier SURNAME
Naming attributes of type X520name
-
GIVENNAME
public static final ASN1ObjectIdentifier GIVENNAME
-
INITIALS
public static final ASN1ObjectIdentifier INITIALS
-
GENERATION
public static final ASN1ObjectIdentifier GENERATION
-
UNIQUE_IDENTIFIER
public static final ASN1ObjectIdentifier UNIQUE_IDENTIFIER
-
DESCRIPTION
public static final ASN1ObjectIdentifier DESCRIPTION
-
BUSINESS_CATEGORY
public static final ASN1ObjectIdentifier BUSINESS_CATEGORY
businessCategory - DirectoryString(SIZE(1..128)
-
POSTAL_CODE
public static final ASN1ObjectIdentifier POSTAL_CODE
postalCode - DirectoryString(SIZE(1..40)
-
DN_QUALIFIER
public static final ASN1ObjectIdentifier DN_QUALIFIER
dnQualifier - DirectoryString(SIZE(1..64)
-
PSEUDONYM
public static final ASN1ObjectIdentifier PSEUDONYM
RFC 3039 Pseudonym - DirectoryString(SIZE(1..64)
-
ROLE
public static final ASN1ObjectIdentifier ROLE
-
DATE_OF_BIRTH
public static final ASN1ObjectIdentifier DATE_OF_BIRTH
RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z
-
PLACE_OF_BIRTH
public static final ASN1ObjectIdentifier PLACE_OF_BIRTH
RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128)
-
GENDER
public static final ASN1ObjectIdentifier GENDER
RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f"
-
COUNTRY_OF_CITIZENSHIP
public static final ASN1ObjectIdentifier COUNTRY_OF_CITIZENSHIP
RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes only
-
COUNTRY_OF_RESIDENCE
public static final ASN1ObjectIdentifier COUNTRY_OF_RESIDENCE
RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes only
-
NAME_AT_BIRTH
public static final ASN1ObjectIdentifier NAME_AT_BIRTH
ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64)
-
POSTAL_ADDRESS
public static final ASN1ObjectIdentifier POSTAL_ADDRESS
RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30))
-
DMD_NAME
public static final ASN1ObjectIdentifier DMD_NAME
RFC 2256 dmdName
-
TELEPHONE_NUMBER
public static final ASN1ObjectIdentifier TELEPHONE_NUMBER
id-at-telephoneNumber
-
NAME
public static final ASN1ObjectIdentifier NAME
id-at-name
-
ORGANIZATION_IDENTIFIER
public static final ASN1ObjectIdentifier ORGANIZATION_IDENTIFIER
id-at-organizationIdentifier
-
EmailAddress
public static final ASN1ObjectIdentifier 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
public static final ASN1ObjectIdentifier UnstructuredName
more from PKCS#9
-
UnstructuredAddress
public static final ASN1ObjectIdentifier UnstructuredAddress
-
E
public static final ASN1ObjectIdentifier E
email address in Verisign certificates
-
DC
public static final ASN1ObjectIdentifier DC
-
UID
public static final ASN1ObjectIdentifier UID
LDAP User id.
-
INSTANCE
public static final X500NameStyle INSTANCE
Singleton instance.
-
defaultLookUp
protected final java.util.Hashtable defaultLookUp
-
defaultSymbols
protected final java.util.Hashtable defaultSymbols
-
-
Method Detail
-
encodeStringValue
protected ASN1Encodable encodeStringValue(ASN1ObjectIdentifier oid, java.lang.String value)
Description copied from class:AbstractX500NameStyleEncoded every value into a UTF8String.Subclasses should overwrite this method to change the encoding of specific types.
- Overrides:
encodeStringValuein classAbstractX500NameStyle- Parameters:
oid- the DN oid of the valuevalue- the String representation of the value- Returns:
- a the value encoded into a ASN.1 object. Never returns
null.
-
oidToDisplayName
public java.lang.String oidToDisplayName(ASN1ObjectIdentifier oid)
Description copied from interface:X500NameStyleReturn the display name for toString() associated with the OID.- Parameters:
oid- the OID of interest.- Returns:
- the name displayed in toString(), null if no mapping provided.
-
oidToAttrNames
public java.lang.String[] oidToAttrNames(ASN1ObjectIdentifier oid)
Description copied from interface:X500NameStyleReturn the acceptable names in a String DN that map to OID.- Parameters:
oid- the OID of interest.- Returns:
- an array of String aliases for the OID, zero length if there are none.
-
attrNameToOID
public ASN1ObjectIdentifier attrNameToOID(java.lang.String attrName)
Description copied from interface:X500NameStyleReturn the OID associated with the passed in name.- Parameters:
attrName- the string to match.- Returns:
- an OID
-
fromString
public RDN[] fromString(java.lang.String dirName)
Description copied from interface:X500NameStyleReturn an array of RDN generated from the passed in String.- Parameters:
dirName- the String representation.- Returns:
- an array of corresponding RDNs.
-
toString
public java.lang.String toString(X500Name name)
Description copied from interface:X500NameStyleConvert the passed in X500Name to a String.- Parameters:
name- the name to convert.- Returns:
- a String representation.
-
-