|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--iaik.asn1.ASN1Object
|
+--iaik.asn1.ObjectID
This class implements the ASN.1 native type "OBJECT IDENTIFIER". OBJECT IDENTIFIER is a simple non-string ASN.1 type identified by the UNIVERSAL TAG number 6. An ASN.1 OBJECT IDENTIFIER object represents an object identifier. It consists of a sequence of integer components and is used for identifying some abstract information object (for instance an algorithm, an attribute type, or even a registration authority that defines other object identifiers).
This class uses Strings as representation of object identifiers. For example: "1.2.3.4".
This class is responsible for generating ObjectIDs for several X.500, PKCS#7,
PKCS#9, PKCS#12 and PKIX objects that may be used by specifying the corresponding
objectID´s name:
ObjectID.<name>,
for instance:
ObjectID policyQualifierId = ObjectID.id_pkix_cps;Beside this, new ObjectIDs may be created by using one of the several constructors, either by only specifying the
OID-String of the new
ObjectID, or by additionally specifying the name
(and the shortName).
When name (and shortName) are specified, they are automatically registered for the
new ObjectID, e.g:
String oidStr = "9.5.12345.17.8"; String name = "myObjectID"; String shortName = "mO"; ObjectID myOID = new ObjectID(oidStr, name, shortName);Otherwise, if only the OID string for the new ObjectID is supplied, no name respectively shortName registration can be performed.
When creating a new ObjectID by means of one of the several constructors, an already
existing ObjectID with the same oid string will be replaced. For that reason it may
be useful to call the hasRegisteredName method
for querying if a name already has been registered for some particular oid before
creating a new one - and overwriting the old one, e.g.:
String oidStr = "9.5.12345.17.8";
String name = "myObjectID";
String shortName = "mO";
ObjectID oid = null;
if (!ObjectID.hasRegisteredName(oidStr)) {
oid = new ObjectID(oidStr, name, shortName);
}
The hasRegisteredName method only will return
true if a name already has been regsitered; in that way, it will return
false, if only an OID string - and no name/shortName - has been specified
when creating the ObjectID in mind.
ASN1Object,
ASN| Field Summary | |
static ObjectID |
caIssuers
Creates an ObjectID for the x.509 AccessDescription access method caIssuers, as defined by RFC 2459. |
static ObjectID |
certTypes
Creates an ObjectID for the PKCS#9 object certTypes. |
static ObjectID |
challengePassword
Creates an ObjectID for the PKCS#9 object challengePassword. |
static ObjectID |
commonName
Creates an ObjectID for the X.500 attribute type commonName (shortName CN). |
static ObjectID |
contentType
Creates an ObjectID for the PKCS#9 object contentType. |
static ObjectID |
countersignature
Creates an ObjectID for the PKCS#9 object countersignature. |
static ObjectID |
country
Creates an ObjectID for the X.500 attribute type countryName (shortName C). |
static ObjectID |
crlTypes
Creates an ObjectID for the PKCS#9 object crlTypes. |
static ObjectID |
dnQualifier
Creates an ObjectID for the x.500 attribute type dnQualifier
(distinguished name qualifier). |
static ObjectID |
domainComponent
Creates an ObjectID for the x.500 attribute type domainComponent
(shortName DC), as defined by RFC 2247. |
static ObjectID |
emailAddress
Creates an ObjectID for the PKCS#9 object emailAddress (shortName EMAIL). |
static ObjectID |
extendedCertificateAttributes
Creates an ObjectID for the PKCS#9 object extendedCertificateAttributes. |
static ObjectID |
friendlyName
Creates an ObjectID for the PKCS#9 object friendlyName. |
static ObjectID |
generationQualifier
Creates an ObjectID for the x.500 attribute type generationQualifier. |
static ObjectID |
givenName
Creates an ObjectID for the x.500 attribute type givenName, added by Telia. |
static ObjectID |
id_pkix_cps
Creates an ObjectID for the PKIX object id-pkix-cps
indicating a CPS Pointer qualifier for defining a (URI) pointer
to a Certification Practice Statement (CPS) describing a particular
CA policy. |
static ObjectID |
id_pkix_unotice
Creates an ObjectID for the PKIX object id-pkix-unotice
indicating a User Notice qualifier for describing a particular
CA policy. |
static ObjectID |
initials
Creates an ObjectID for the x.500 attribute type initials. |
static ObjectID |
locality
Creates an ObjectID for the X.500 attribute type localityName (shortName L). |
static ObjectID |
localKeyID
Creates an ObjectID for the PKCS#9 object localKeyID. |
static ObjectID |
messageDigest
Creates an ObjectID for the PKCS#9 object messageDigest. |
static ObjectID |
netscape
The Netscape base object identifier. |
static ObjectID |
netscapeCertSequence
The Netscape cert seequence object identifier. |
static ObjectID |
organization
Creates an ObjectID for the X.500 attribute type organizationName (shortName O). |
static ObjectID |
organizationalUnit
Creates an ObjectID for the X.500 attribute type organizationalUnitName (shortName OU). |
static ObjectID |
pkcs12_certBag
Creates an ObjectID for the PKCS#12 object PKCS#12 certBag. |
static ObjectID |
pkcs12_CertBagIds
Creates an ObjectID for the PKCS#12 object PKCS#12 CertBagIds
When using it, type ObjectID.pkcs12_CertBagIds |
static ObjectID |
pkcs12_crlBag
Creates an ObjectID for the PKCS#12 object PKCS#12 crlBag. |
static ObjectID |
pkcs12_keyBag
Creates an ObjectID for the PKCS#12 object PKCS#12 keyBag. |
static ObjectID |
pkcs12_pkcs8ShroudedKeyBag
Creates an ObjectID for the PKCS#12 object PKCS#12 pkcs8ShroudedKeyBag. |
static ObjectID |
pkcs12_safeContentsBag
Creates an ObjectID for the PKCS#12 object PKCS#12 safeContentsBag. |
static ObjectID |
pkcs12_SDSICertBagId
Creates an ObjectID for the PKCS#12 object PKCS#12 SDSICertBagId. |
static ObjectID |
pkcs12_secretBag
Creates an ObjectID for the PKCS#12 object PKCS#12 secretBag. |
static ObjectID |
pkcs12_Version1
Creates an ObjectID for the PKCS#12 object PKCS#12 Version1. |
static ObjectID |
pkcs12_Version1_BagIds
Creates an ObjectID for the PKCS#12 object PKCS#12 Version1 BagIds. |
static ObjectID |
pkcs12_x509CertCRLBagId
Creates an ObjectID for the PKCS#12 object PKCS#12 x509CertCRLBagId. |
static ObjectID |
pkcs7
Creates an ObjectID for the PKCS#7 object PKCS#7. |
static ObjectID |
pkcs7_data
Creates an ObjectID for the PKCS#7 object PKCS#7 data. |
static ObjectID |
pkcs7_digestedData
Creates an ObjectID for the PKCS#7 object PKCS#7 digestedData. |
static ObjectID |
pkcs7_encryptedData
Creates an ObjectID for the PKCS#7 object PKCS#7 encryptedData. |
static ObjectID |
pkcs7_envelopedData
Creates an ObjectID for the PKCS#7 object PKCS#7 envelopedData. |
static ObjectID |
pkcs7_signedAndEnvelopedData
Creates an ObjectID for the PKCS#7 object PKCS#7 signedAndEnvelopedData. |
static ObjectID |
pkcs7_signedData
Creates an ObjectID for the PKCS#7 object PKCS#7 signedData. |
static ObjectID |
sdsiCertificate
Creates an ObjectID for the PKCS#9 object sdsiCertificate. |
static ObjectID |
serialNumber
Creates an ObjectID for the X.500 attribute type serialNumber (shortName CN). |
static ObjectID |
signingDescription
Creates an ObjectID for the PKCS#9 object signingDescription. |
static ObjectID |
signingTime
Creates an ObjectID for the PKCS#9 object signingTime. |
static ObjectID |
stateOrProvince
Creates an ObjectID for the X.500 attribute type stateOrProvinceName (shortName ST). |
static ObjectID |
streetAddress
Creates an ObjectID for the X.500 attribute type streetAddress (shortName STREET). |
static ObjectID |
surName
Creates an ObjectID for the x.500 attribute type surname (shortName SN), added by Telia. |
static ObjectID |
symmetricCapabilities
Creates an ObjectID for the PKCS#9 object symmetricCapabilities. |
static ObjectID |
title
Creates an ObjectID for the X.500 attribute type title (shortName T). |
static ObjectID |
uniqueIdentifier
Creates an ObjectID for the x.500 attribute type uniqueIdentifier, added by Telia. |
static ObjectID |
unstructuredAddress
Creates the PKCS#9 ObjectID unstructeredAddress. |
static ObjectID |
unstructuredName
Creates an ObjectID for the PKCS#9 object unstructeredName. |
static ObjectID |
x509Certificate
Creates an ObjectID for the PKCS#9 object x509Certificate. |
static ObjectID |
x509Crl
Creates an ObjectID for the PKCS#9 object x509Crl. |
| Fields inherited from class iaik.asn1.ASN1Object |
asnType,
encode_listener,
stream_mode |
| Constructor Summary | |
protected |
ObjectID()
The default constructor. |
|
ObjectID(java.lang.String oid)
Constructs an ObjectID from a String. |
|
ObjectID(java.lang.String oid,
java.lang.String name)
Constructs an ObjectID from a String representation and a String name. |
|
ObjectID(java.lang.String oid,
java.lang.String name,
java.lang.String shortName)
Constructs an ObjectID from a String representation, a String name, and a String shortName. |
| Method Summary | |
protected void |
decode(int length,
java.io.InputStream is)
Decodes the next available data from the InputStream. |
protected void |
encode(java.io.OutputStream os)
DER encodes this OBjectID ASN1Object and writes the result to given OutputStream. |
boolean |
equals(java.lang.Object obj)
Compares this ObjectID to the specified object. |
java.lang.String |
getID()
Returns the objectID as string. |
static ObjectID |
getInstance(java.lang.String name)
This method is responsible for returning an ObjectID given either the registered name or the short name of any existing OID that has already been registered. |
java.lang.String |
getName()
Returns the name registered for this ObjectID or the object identifier if there is no name registered. |
java.lang.String |
getShortName()
Returns the short name registered for this ObjectID. |
java.lang.Object |
getValue()
Returns the value of this ObjectID as a String object. |
int |
hashCode()
Returns a hash code for this object. |
static boolean |
hasRegisteredName(java.lang.String oid)
Looks if a name for the object identifier specified by the given OID string already is registered. |
void |
setValue(java.lang.Object object)
Sets the value of this object to value (e.g. |
java.lang.String |
toString()
Returns a string that represents the contents of the ObjectID. |
| Methods inherited from class iaik.asn1.ASN1Object |
addComponent,
addEncodeListener,
countComponents,
encodeObject,
getAsnType,
getComponentAt,
indefiniteLength,
isA,
isConstructed,
setIndefiniteLength,
setIndefiniteRecursive |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static ObjectID commonName
commonName (shortName CN).
When using it, type ObjectID.commonNamepublic static ObjectID serialNumber
serialNumber (shortName CN).
When using it, type ObjectID.serialNumber.public static ObjectID country
countryName (shortName C).
When using it, type ObjectID.countrypublic static ObjectID locality
localityName (shortName L).
When using it, type ObjectID.localitypublic static ObjectID stateOrProvince
stateOrProvinceName (shortName ST).
When using it, type ObjectID.stateOrProvincepublic static ObjectID streetAddress
streetAddress (shortName STREET).
When using it, type ObjectID.streetAddresspublic static ObjectID organization
organizationName (shortName O).
When using it, type ObjectID.organizationpublic static ObjectID organizationalUnit
organizationalUnitName (shortName OU).
When using it, type ObjectID.organizationalUnitpublic static ObjectID title
title (shortName T).
When using it, type ObjectID.titlepublic static ObjectID surName
surname (shortName SN), added by Telia.
When using it, type ObjectID.surNamepublic static ObjectID givenName
givenName, added by Telia.
When using it, type ObjectID.givenName.public static ObjectID initials
initials.
When using it, type ObjectID.initialspublic static ObjectID generationQualifier
generationQualifier.
When using it, type ObjectID.generationQualifier.public static ObjectID uniqueIdentifier
uniqueIdentifier, added by Telia.
When using it, type ObjectID.uniqueIdentifier.public static ObjectID dnQualifier
dnQualifier
(distinguished name qualifier).
When using it, type ObjectID.dnQualifier.public static ObjectID domainComponent
domainComponent
(shortName DC), as defined by RFC 2247.
When using it, type ObjectID.domainComponent.public static ObjectID caIssuers
caIssuers, as defined by RFC 2459.
When using it, type ObjectID.caIssuers.public static ObjectID pkcs7
PKCS#7.
When using it, type ObjectID.pkcs7public static ObjectID pkcs7_data
PKCS#7 data.
When using it, type ObjectID.pkcs7_datapublic static ObjectID pkcs7_signedData
PKCS#7 signedData.
When using it, type ObjectID.pkcs7_signedDatapublic static ObjectID pkcs7_envelopedData
PKCS#7 envelopedData.
When using it, type ObjectID.pkcs7_envelopedDatapublic static ObjectID pkcs7_signedAndEnvelopedData
PKCS#7 signedAndEnvelopedData.
When using it, type ObjectID.pkcs7_signedAndEnvelopedDatapublic static ObjectID pkcs7_digestedData
PKCS#7 digestedData.
When using it, type ObjectID.pkcs7_digestedDatapublic static ObjectID pkcs7_encryptedData
PKCS#7 encryptedData.
When using it, type ObjectID.pkcs7_encryptedDatapublic static ObjectID emailAddress
emailAddress (shortName EMAIL).
When using it, type ObjectID.emailAddresspublic static ObjectID unstructuredName
unstructeredName.
When using it, type ObjectID.unstructeredNamepublic static ObjectID contentType
contentType.
When using it, type ObjectID.contentTypepublic static ObjectID messageDigest
messageDigest.
When using it, type ObjectID.messageDigestpublic static ObjectID signingTime
signingTime.
When using it, type ObjectID.signingTimepublic static ObjectID countersignature
countersignature.
When using it, type ObjectID.countersignaturepublic static ObjectID challengePassword
challengePassword.
When using it, type ObjectID.challengePasswordpublic static ObjectID unstructuredAddress
unstructeredAddress.
When using it, type ObjectID.unstructeredAddresspublic static ObjectID extendedCertificateAttributes
extendedCertificateAttributes.
When using it, type ObjectID.extendedCertificateAttributespublic static ObjectID signingDescription
signingDescription.
When using it, type ObjectID.signingDescriptionpublic static ObjectID symmetricCapabilities
symmetricCapabilities.
When using it, type ObjectID.symmetricCapabilitiespublic static ObjectID friendlyName
friendlyName.
When using it, type ObjectID.friendlyNamepublic static ObjectID localKeyID
localKeyID.
When using it, type ObjectID.localKeyIDpublic static ObjectID certTypes
certTypes.
When using it, type ObjectID.certTypespublic static ObjectID x509Certificate
x509Certificate.
When using it, type ObjectID.x509Certificatepublic static ObjectID sdsiCertificate
sdsiCertificate.
When using it, type ObjectID.sdsiCertificatepublic static ObjectID crlTypes
crlTypes.
When using it, type ObjectID.crlTypespublic static ObjectID x509Crl
x509Crl.
When using it, type ObjectID.x509Crlpublic static ObjectID pkcs12_CertBagIds
PKCS#12 CertBagIds
When using it, type ObjectID.pkcs12_CertBagIdspublic static ObjectID pkcs12_x509CertCRLBagId
PKCS#12 x509CertCRLBagId.
When using it, type ObjectID.pkcs12_x509CertCRLBagId public static ObjectID pkcs12_SDSICertBagId
PKCS#12 SDSICertBagId.
When using it, type ObjectID.pkcs12_SDSICertBagId public static ObjectID pkcs12_Version1
PKCS#12 Version1.
When using it, type ObjectID.pkcs12_Version1 public static ObjectID pkcs12_Version1_BagIds
PKCS#12 Version1 BagIds.
When using it, type ObjectID.pkcs12_Version1_BagIds public static ObjectID pkcs12_keyBag
PKCS#12 keyBag.
When using it, type ObjectID.pkcs12_keyBag public static ObjectID pkcs12_pkcs8ShroudedKeyBag
PKCS#12 pkcs8ShroudedKeyBag.
When using it, type ObjectID.pkcs12_pkcs8ShroudedKeyBag public static ObjectID pkcs12_certBag
PKCS#12 certBag.
When using it, type ObjectID.pkcs12_certBag public static ObjectID pkcs12_crlBag
PKCS#12 crlBag.
When using it, type ObjectID.pkcs12_crlBag public static ObjectID pkcs12_secretBag
PKCS#12 secretBag.
When using it, type ObjectID.pkcs12_secretBag public static ObjectID pkcs12_safeContentsBag
PKCS#12 safeContentsBag.
When using it, type ObjectID.pkcs12_safeContentsBag public static ObjectID id_pkix_cps
id-pkix-cps
indicating a CPS Pointer qualifier for defining a (URI) pointer
to a Certification Practice Statement (CPS) describing a particular
CA policy.
When using it, type ObjectID.id_pkix_cps
public static ObjectID id_pkix_unotice
id-pkix-unotice
indicating a User Notice qualifier for describing a particular
CA policy.
When using it, type ObjectID.id_pkix_unotice
public static ObjectID netscape
ObjectID.netscape.public static ObjectID netscapeCertSequence
ObjectID.netscapeCertSequence.| Constructor Detail |
protected ObjectID()
public ObjectID(java.lang.String oid)
oid - the objectID as String, e.g. "1.2.3.4"
public ObjectID(java.lang.String oid,
java.lang.String name)
hasRegisteredName method for querying
if a name for the particular oid already has been registered, e.g.:
String oidStr = "9.5.12345.17.8";
String name = "myObjectID";
ObjectID oid = null;
if (!ObjectID.hasRegisteredName(oidStr)) {
oid = new ObjectID(oidStr, name);
}
oid - the objectID as String, e.g. "1.2.3.4"name - a name for the objectID
public ObjectID(java.lang.String oid,
java.lang.String name,
java.lang.String shortName)
hasRegisteredName method for querying
if a name for the particular oid already has been registered, e.g.:
String oidStr = "9.5.12345.17.8";
String name = "myObjectID";
String shortName = "mO";
ObjectID oid = null;
if (!ObjectID.hasRegisteredName(oidStr)) {
oid = new ObjectID(oidStr, name, shortName);
}
oid - the objectID as String, e.g. "1.2.3.4"name - a name for the objectID, e.g. "commonName"shortName - a short name for the objectID e.g. "CN"| Method Detail |
public static boolean hasRegisteredName(java.lang.String oid)
oid - the OID-String specifying the object identifier to be looked for,
e.g. "1.2.4.5"true if a name for the object identifier with this OID specification
already is registered, false otherwisepublic static ObjectID getInstance(java.lang.String name)
public java.lang.Object getValue()
public void setValue(java.lang.Object object)
object - the value (na OID string) to be set for this ObjectIDpublic java.lang.String getID()
public java.lang.String getName()
public java.lang.String getShortName()
public int hashCode()
public boolean equals(java.lang.Object obj)
obj - - the object to compare this ObjectID against.true, if the object is equal to this ObjectID
false otherwise
protected void encode(java.io.OutputStream os)
throws java.io.IOException
os - the output stream to which to write the encoded data
protected void decode(int length,
java.io.InputStream is)
throws java.io.IOException
length - the length of the ASN1Object which shall be decodedis - the input stream from which the DER encoded data is read inpublic java.lang.String toString()
ASN1Object.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||