kz.gamma.asn1.x500.style
Class BCStyle

java.lang.Object
  extended by kz.gamma.asn1.x500.style.BCStyle
All Implemented Interfaces:
X500NameStyle
Direct Known Subclasses:
BCStrictStyle

public class BCStyle
extends java.lang.Object
implements X500NameStyle


Field Summary
static DERObjectIdentifier BUSINESS_CATEGORY
          businessCategory - DirectoryString(SIZE(1..128)
static DERObjectIdentifier C
          country code - StringType(SIZE(2))
static DERObjectIdentifier CN
          common name - StringType(SIZE(1..64))
static DERObjectIdentifier COUNTRY_OF_CITIZENSHIP
          RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes only
static DERObjectIdentifier COUNTRY_OF_RESIDENCE
          RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes only
static DERObjectIdentifier DATE_OF_BIRTH
          RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z
static DERObjectIdentifier DC
           
private static java.util.Hashtable DefaultLookUp
          look up table translating common symbols into their OIDS.
private static java.util.Hashtable DefaultSymbols
          default look up table translating OID values into their common symbols following the convention in RFC 2253 with a few extras
static DERObjectIdentifier DMD_NAME
          RFC 2256 dmdName
static DERObjectIdentifier DN_QUALIFIER
          dnQualifier - DirectoryString(SIZE(1..64)
static DERObjectIdentifier E
          email address in Verisign certificates
static DERObjectIdentifier EmailAddress
          Email address (RSA PKCS#9 extension) - IA5String.
static DERObjectIdentifier GENDER
          RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f"
static DERObjectIdentifier GENERATION
           
static DERObjectIdentifier GIVENNAME
           
static DERObjectIdentifier INITIALS
           
static X500NameStyle INSTANCE
           
static DERObjectIdentifier L
          locality name - StringType(SIZE(1..64))
static DERObjectIdentifier NAME
          id-at-name
static DERObjectIdentifier NAME_AT_BIRTH
          ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64)
static DERObjectIdentifier O
          organization - StringType(SIZE(1..64))
static DERObjectIdentifier OU
          organizational unit name - StringType(SIZE(1..64))
static DERObjectIdentifier PLACE_OF_BIRTH
          RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128)
static DERObjectIdentifier POSTAL_ADDRESS
          RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30))
static DERObjectIdentifier POSTAL_CODE
          postalCode - DirectoryString(SIZE(1..40)
static DERObjectIdentifier PSEUDONYM
          RFC 3039 Pseudonym - DirectoryString(SIZE(1..64)
static DERObjectIdentifier SERIALNUMBER
          device serial number name - StringType(SIZE(1..64))
static DERObjectIdentifier SN
          device serial number name - StringType(SIZE(1..64))
static DERObjectIdentifier ST
          state, or province name - StringType(SIZE(1..64))
static DERObjectIdentifier STREET
          street - StringType(SIZE(1..64))
static DERObjectIdentifier SURNAME
          Naming attributes of type X520name
static DERObjectIdentifier T
          Title
static DERObjectIdentifier TELEPHONE_NUMBER
          id-at-telephoneNumber
static DERObjectIdentifier UID
          LDAP User id.
static DERObjectIdentifier UNIQUE_IDENTIFIER
           
static DERObjectIdentifier UnstructuredAddress
           
static DERObjectIdentifier UnstructuredName
          more from PKCS#9
 
Constructor Summary
protected BCStyle()
           
 
Method Summary
 boolean areEqual(X500Name name1, X500Name name2)
          Return true if the two names are equal.
 DERObjectIdentifier attrNameToOID(java.lang.String attrName)
          Return the OID associated with the passed in name.
private  int calcHashCode(ASN1Encodable enc)
           
 int calculateHashCode(X500Name name)
          Calculate a hashCode for the passed in name.
private  boolean foundMatch(boolean reverse, RDN rdn, RDN[] possRDNs)
           
 RDN[] fromString(java.lang.String dirName)
          Return an array of RDN generated from the passed in String.
 java.lang.String[] oidToAttrNames(DERObjectIdentifier oid)
          Return the acceptable names in a String DN that map to OID.
 java.lang.String oidToDisplayName(DERObjectIdentifier oid)
          Return the display name for toString() associated with the OID.
protected  boolean rdnAreEqual(RDN rdn1, RDN rdn2)
           
 ASN1Encodable stringToValue(DERObjectIdentifier oid, java.lang.String value)
          Convert the passed in String value into the appropriate ASN.1 encoded object.
 java.lang.String toString(X500Name name)
          Convert the passed in X500Name to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final X500NameStyle INSTANCE

C

public static final DERObjectIdentifier C
country code - StringType(SIZE(2))


O

public static final DERObjectIdentifier O
organization - StringType(SIZE(1..64))


OU

public static final DERObjectIdentifier OU
organizational unit name - StringType(SIZE(1..64))


T

public static final DERObjectIdentifier T
Title


CN

public static final DERObjectIdentifier CN
common name - StringType(SIZE(1..64))


SN

public static final DERObjectIdentifier SN
device serial number name - StringType(SIZE(1..64))


STREET

public static final DERObjectIdentifier STREET
street - StringType(SIZE(1..64))


SERIALNUMBER

public static final DERObjectIdentifier SERIALNUMBER
device serial number name - StringType(SIZE(1..64))


L

public static final DERObjectIdentifier L
locality name - StringType(SIZE(1..64))


ST

public static final DERObjectIdentifier ST
state, or province name - StringType(SIZE(1..64))


SURNAME

public static final DERObjectIdentifier SURNAME
Naming attributes of type X520name


GIVENNAME

public static final DERObjectIdentifier GIVENNAME

INITIALS

public static final DERObjectIdentifier INITIALS

GENERATION

public static final DERObjectIdentifier GENERATION

UNIQUE_IDENTIFIER

public static final DERObjectIdentifier UNIQUE_IDENTIFIER

BUSINESS_CATEGORY

public static final DERObjectIdentifier BUSINESS_CATEGORY
businessCategory - DirectoryString(SIZE(1..128)


POSTAL_CODE

public static final DERObjectIdentifier POSTAL_CODE
postalCode - DirectoryString(SIZE(1..40)


DN_QUALIFIER

public static final DERObjectIdentifier DN_QUALIFIER
dnQualifier - DirectoryString(SIZE(1..64)


PSEUDONYM

public static final DERObjectIdentifier PSEUDONYM
RFC 3039 Pseudonym - DirectoryString(SIZE(1..64)


DATE_OF_BIRTH

public static final DERObjectIdentifier DATE_OF_BIRTH
RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z


PLACE_OF_BIRTH

public static final DERObjectIdentifier PLACE_OF_BIRTH
RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128)


GENDER

public static final DERObjectIdentifier GENDER
RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f"


COUNTRY_OF_CITIZENSHIP

public static final DERObjectIdentifier COUNTRY_OF_CITIZENSHIP
RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes only


COUNTRY_OF_RESIDENCE

public static final DERObjectIdentifier COUNTRY_OF_RESIDENCE
RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes only


NAME_AT_BIRTH

public static final DERObjectIdentifier NAME_AT_BIRTH
ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64)


POSTAL_ADDRESS

public static final DERObjectIdentifier POSTAL_ADDRESS
RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30))


DMD_NAME

public static final DERObjectIdentifier DMD_NAME
RFC 2256 dmdName


TELEPHONE_NUMBER

public static final DERObjectIdentifier TELEPHONE_NUMBER
id-at-telephoneNumber


NAME

public static final DERObjectIdentifier NAME
id-at-name


EmailAddress

public static final DERObjectIdentifier 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 DERObjectIdentifier UnstructuredName
more from PKCS#9


UnstructuredAddress

public static final DERObjectIdentifier UnstructuredAddress

E

public static final DERObjectIdentifier E
email address in Verisign certificates


DC

public static final DERObjectIdentifier DC

UID

public static final DERObjectIdentifier UID
LDAP User id.


DefaultSymbols

private static final java.util.Hashtable DefaultSymbols
default look up table translating OID values into their common symbols following the convention in RFC 2253 with a few extras


DefaultLookUp

private static final java.util.Hashtable DefaultLookUp
look up table translating common symbols into their OIDS.

Constructor Detail

BCStyle

protected BCStyle()
Method Detail

stringToValue

public ASN1Encodable stringToValue(DERObjectIdentifier oid,
                                   java.lang.String value)
Description copied from interface: X500NameStyle
Convert the passed in String value into the appropriate ASN.1 encoded object.

Specified by:
stringToValue in interface X500NameStyle
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

public java.lang.String oidToDisplayName(DERObjectIdentifier oid)
Description copied from interface: X500NameStyle
Return the display name for toString() associated with the OID.

Specified by:
oidToDisplayName in interface X500NameStyle
Parameters:
oid - the OID of interest.
Returns:
the name displayed in toString(), null if no mapping provided.

oidToAttrNames

public java.lang.String[] oidToAttrNames(DERObjectIdentifier oid)
Description copied from interface: X500NameStyle
Return the acceptable names in a String DN that map to OID.

Specified by:
oidToAttrNames in interface X500NameStyle
Parameters:
oid - the OID of interest.
Returns:
an array of String aliases for the OID, zero length if there are none.

attrNameToOID

public DERObjectIdentifier attrNameToOID(java.lang.String attrName)
Description copied from interface: X500NameStyle
Return the OID associated with the passed in name.

Specified by:
attrNameToOID in interface X500NameStyle
Parameters:
attrName - the string to match.
Returns:
an OID

areEqual

public boolean areEqual(X500Name name1,
                        X500Name name2)
Description copied from interface: X500NameStyle
Return true if the two names are equal.

Specified by:
areEqual in interface X500NameStyle
Parameters:
name1 - first name for comparison.
name2 - second name for comparison.
Returns:
true if name1 = name 2, false otherwise.

foundMatch

private boolean foundMatch(boolean reverse,
                           RDN rdn,
                           RDN[] possRDNs)

rdnAreEqual

protected boolean rdnAreEqual(RDN rdn1,
                              RDN rdn2)

fromString

public RDN[] fromString(java.lang.String dirName)
Description copied from interface: X500NameStyle
Return an array of RDN generated from the passed in String.

Specified by:
fromString in interface X500NameStyle
Parameters:
dirName - the String representation.
Returns:
an array of corresponding RDNs.

calculateHashCode

public int calculateHashCode(X500Name name)
Description copied from interface: X500NameStyle
Calculate a hashCode for the passed in name.

Specified by:
calculateHashCode in interface X500NameStyle
Parameters:
name - the name the hashCode is required for.
Returns:
the calculated hashCode.

calcHashCode

private int calcHashCode(ASN1Encodable enc)

toString

public java.lang.String toString(X500Name name)
Description copied from interface: X500NameStyle
Convert the passed in X500Name to a String.

Specified by:
toString in interface X500NameStyle
Parameters:
name - the name to convert.
Returns:
a String representation.


Copyright © 1998-2014 Gamma Technologies. All Rights Reserved.