be.cardon.asn1.x509
Class AttributeTypeAndValue

java.lang.Object
  extended by org.bouncycastle.asn1.ASN1Encodable
      extended by be.cardon.asn1.x509.AttributeTypeAndValue
All Implemented Interfaces:
org.bouncycastle.asn1.DEREncodable

public class AttributeTypeAndValue
extends org.bouncycastle.asn1.ASN1Encodable

AttributeTypeAndValue ASN.1 object. *

Documentation from RFC 3280:

 AttributeTypeAndValue           ::=     SEQUENCE {
 type    AttributeType,
 value   AttributeValue }

 AttributeType           ::=  OBJECT IDENTIFIER

 AttributeValue          ::=  ANY

See also the Attribute object :

 Attribute       ::=     SEQUENCE {
 type              AttributeType,
 values    SET OF AttributeValue }
 -- at least one value is required
 


Field Summary
static org.bouncycastle.asn1.DERObjectIdentifier BUSINESS_CATEGORY
          businessCategory - DirectoryString(SIZE(1..128)
static org.bouncycastle.asn1.DERObjectIdentifier C
          country code - StringType(SIZE(2))
static org.bouncycastle.asn1.DERObjectIdentifier CN
          common name - StringType(SIZE(1..64))
static org.bouncycastle.asn1.DERObjectIdentifier COUNTRY_OF_CITIZENSHIP
          RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes only
static org.bouncycastle.asn1.DERObjectIdentifier COUNTRY_OF_RESIDENCE
          RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes only
static org.bouncycastle.asn1.DERObjectIdentifier DATE_OF_BIRTH
          RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z
static org.bouncycastle.asn1.DERObjectIdentifier DC
           
static java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> DefaultSymbols
           
static org.bouncycastle.asn1.DERObjectIdentifier DN_QUALIFIER
          dnQualifier - DirectoryString(SIZE(1..64)
static org.bouncycastle.asn1.DERObjectIdentifier GENDER
          RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f"
static org.bouncycastle.asn1.DERObjectIdentifier GENERATION
           
static org.bouncycastle.asn1.DERObjectIdentifier GIVENNAME
           
static org.bouncycastle.asn1.DERObjectIdentifier INITIALS
           
static org.bouncycastle.asn1.DERObjectIdentifier L
          locality name - StringType(SIZE(1..64))
static org.bouncycastle.asn1.DERObjectIdentifier NAME_AT_BIRTH
          ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64)
static org.bouncycastle.asn1.DERObjectIdentifier O
          organization - StringType(SIZE(1..64))
static org.bouncycastle.asn1.DERObjectIdentifier OU
          organizational unit name - StringType(SIZE(1..64))
static org.bouncycastle.asn1.DERObjectIdentifier PLACE_OF_BIRTH
          RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128)
static org.bouncycastle.asn1.DERObjectIdentifier POSTAL_ADDRESS
          RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30))
static org.bouncycastle.asn1.DERObjectIdentifier POSTAL_CODE
          postalCode - DirectoryString(SIZE(1..40)
static org.bouncycastle.asn1.DERObjectIdentifier PSEUDONYM
          RFC 3039 Pseudonym - DirectoryString(SIZE(1..64)
static org.bouncycastle.asn1.DERObjectIdentifier SERIALNUMBER
          device serial number name - StringType(SIZE(1..64)) Serial
static org.bouncycastle.asn1.DERObjectIdentifier ST
          state, or province name - StringType(SIZE(1..64))
static org.bouncycastle.asn1.DERObjectIdentifier STREET
          street - StringType(SIZE(1..64))
static org.bouncycastle.asn1.DERObjectIdentifier SURNAME
          Naming attributes of type X520name
static org.bouncycastle.asn1.DERObjectIdentifier T
          Title
static org.bouncycastle.asn1.DERObjectIdentifier UID
          LDAP User id.
static org.bouncycastle.asn1.DERObjectIdentifier UNIQUE_IDENTIFIER
           
 
Fields inherited from class org.bouncycastle.asn1.ASN1Encodable
BER, DER
 
Constructor Summary
AttributeTypeAndValue(org.bouncycastle.asn1.ASN1Sequence seq)
          Decodes an existing AttributeTypeAndValue ASN.1 object.
AttributeTypeAndValue(org.bouncycastle.asn1.DERObjectIdentifier attributeType, org.bouncycastle.asn1.DEREncodable attributeValue)
          Creates an new instance from a given set of AttributeTypeAndValue.
 
Method Summary
 org.bouncycastle.asn1.DERObjectIdentifier getAttributeType()
          Returns the AttributeType.
 org.bouncycastle.asn1.DEREncodable getAttributeValue()
          Returns the AttributeValue.
static java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> getDefaultMap()
           
static AttributeTypeAndValue getInstance(java.lang.Object obj)
          Creates an new object from an existing ASN1Sequence or AttributeTypeAndValue object.
static java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> getRFC2253OIDMap()
          Returns the map defined in RFC2253.
 org.bouncycastle.asn1.DERObject toASN1Object()
          
 java.lang.String toRFC2253()
          Returns the RFC2253 string representation using default map(see §2.3).
 java.lang.String toRFC2253(java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> typeMap)
          Returns the RFC2253 string representation (see §2.3).
 java.lang.String toString()
          Returns a non standard string representation.
 
Methods inherited from class org.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

C

public static final org.bouncycastle.asn1.DERObjectIdentifier C
country code - StringType(SIZE(2))


O

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


OU

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


T

public static final org.bouncycastle.asn1.DERObjectIdentifier T
Title


CN

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


SERIALNUMBER

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


STREET

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


L

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


ST

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


SURNAME

public static final org.bouncycastle.asn1.DERObjectIdentifier SURNAME
Naming attributes of type X520name


GIVENNAME

public static final org.bouncycastle.asn1.DERObjectIdentifier GIVENNAME

INITIALS

public static final org.bouncycastle.asn1.DERObjectIdentifier INITIALS

GENERATION

public static final org.bouncycastle.asn1.DERObjectIdentifier GENERATION

UNIQUE_IDENTIFIER

public static final org.bouncycastle.asn1.DERObjectIdentifier UNIQUE_IDENTIFIER

BUSINESS_CATEGORY

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


POSTAL_CODE

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


DN_QUALIFIER

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


PSEUDONYM

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


DATE_OF_BIRTH

public static final org.bouncycastle.asn1.DERObjectIdentifier DATE_OF_BIRTH
RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z


PLACE_OF_BIRTH

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


GENDER

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


COUNTRY_OF_CITIZENSHIP

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


COUNTRY_OF_RESIDENCE

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


NAME_AT_BIRTH

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


POSTAL_ADDRESS

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


DC

public static final org.bouncycastle.asn1.DERObjectIdentifier DC

UID

public static final org.bouncycastle.asn1.DERObjectIdentifier UID
LDAP User id.


DefaultSymbols

public static java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> DefaultSymbols
Constructor Detail

AttributeTypeAndValue

public AttributeTypeAndValue(org.bouncycastle.asn1.ASN1Sequence seq)
Decodes an existing AttributeTypeAndValue ASN.1 object.

Parameters:
seq - ASN.1 Sequence being the {code AttributeTypeAndValue}.

AttributeTypeAndValue

public AttributeTypeAndValue(org.bouncycastle.asn1.DERObjectIdentifier attributeType,
                             org.bouncycastle.asn1.DEREncodable attributeValue)
Creates an new instance from a given set of AttributeTypeAndValue.

Method Detail

getInstance

public static AttributeTypeAndValue getInstance(java.lang.Object obj)
Creates an new object from an existing ASN1Sequence or AttributeTypeAndValue object.

Throws:
java.lang.IllegalArgumentException - if the object is invalid.

getAttributeType

public org.bouncycastle.asn1.DERObjectIdentifier getAttributeType()
Returns the AttributeType.


getAttributeValue

public org.bouncycastle.asn1.DEREncodable getAttributeValue()
Returns the AttributeValue.


toASN1Object

public org.bouncycastle.asn1.DERObject toASN1Object()

Specified by:
toASN1Object in class org.bouncycastle.asn1.ASN1Encodable

toRFC2253

public java.lang.String toRFC2253(java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> typeMap)
Returns the RFC2253 string representation (see §2.3).

Documentation from RFC2253:

 If the AttributeType is in a published table of attribute types
 associated with LDAP [4], then the type name string from that table
 is used, otherwise it is encoded as the dotted-decimal encoding of
 the AttributeType's OBJECT IDENTIFIER. The dotted-decimal notation is
 described in [3].

Parameters:
typeMap - the published table of attribute types associated with LDAP. If null, the default map is used.

toRFC2253

public java.lang.String toRFC2253()
Returns the RFC2253 string representation using default map(see §2.3).

Documentation from RFC2253:

 If the AttributeType is in a published table of attribute types
 associated with LDAP [4], then the type name string from that table
 is used, otherwise it is encoded as the dotted-decimal encoding of
 the AttributeType's OBJECT IDENTIFIER. The dotted-decimal notation is
 described in [3].


toString

public java.lang.String toString()
Returns a non standard string representation.

Overrides:
toString in class java.lang.Object

getRFC2253OIDMap

public static java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> getRFC2253OIDMap()
Returns the map defined in RFC2253.
 String  X.500 AttributeType
 ------------------------------
 CN      commonName
 L       localityName
 ST      stateOrProvinceName
 O       organizationName
 OU      organizationalUnitName
 C       countryName
 STREET  streetAddress
 DC      domainComponent
 UID     userid
 


getDefaultMap

public static java.util.Map<org.bouncycastle.asn1.DERObjectIdentifier,java.lang.String> getDefaultMap()