Skip navigation links

Oracle Security Developer Tools CMS Java API Reference
11g (11.1.1)

E10667-02


oracle.security.crypto.cms
Class ESSCertID

java.lang.Object
  extended by oracle.security.crypto.cms.ESSCertID

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class ESSCertID
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object

Represents the ESSCertID of a certificate which is used in the Signing Certificate Attribute.


Constructor Summary
ESSCertID(java.io.InputStream is)
          Creates a new ESSCertID by reading from the input stream.
ESSCertID(java.security.cert.X509Certificate cert)
          Creates a new ESSCertID for the specified certificate.
ESSCertID(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert, boolean issuerSerial)
          Creates a new ESSCertID for the specified certificate.

 

Method Summary
 boolean compareTo(java.security.cert.X509Certificate cert)
          Compare this object with the ESSCertID object created from the given certificate.
 boolean compareTo(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert)
          Compare this object with the ESSCertID object created from the two given certificates.
 boolean containsIssuerSerial()
          Indicates if the IssuerSerial is present.
 boolean equals(java.lang.Object o)
          Compares this ESSCertID object to the given object.
 byte[] getCertHash()
          Returns the hash of the certificate represented by this ESSCertID object.
 oracle.security.crypto.cert.GeneralNames getGeneralNames()
          Returns the list of the General Names of the issuer of the certificate represented by this ESSCertID object.
 java.math.BigInteger getSerialNo()
          Returns the serial number of the of the certificate represented by this ESSCertID object.
 int hashCode()
          Returns the hash code of this object.
 void input(java.io.InputStream is)
          Initialize this object by reading the ESSCertID encoding from the specified input stream.
 int length()
          Returns the length of this object's encoding.
 void output(java.io.OutputStream os)
          Output this object's encoding to the specified output stream.
 java.lang.String toString()
          Returns information about this object.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ESSCertID

public ESSCertID(java.security.cert.X509Certificate cert)
          throws java.security.NoSuchAlgorithmException,
                 java.security.cert.CertificateEncodingException
Creates a new ESSCertID for the specified certificate.

Note the changes in the method signature

Previously public ESSCertID( X509 )

Now public ESSCertID(X509Certificate)

Note the changes in the exceptions thrown

Exceptions no longer thrown -- AlgorithmIdentifierException

Exceptions introduced -- NoSuchAlgorithmException,CertificateEncodingException

Parameters:
cert - The X509 certificate.
Throws:
java.security.NoSuchAlgorithmException - An error occurred during certificate hash generation.
java.security.cert.CertificateEncodingException - Error while encoding the certificate

ESSCertID

public ESSCertID(java.security.cert.X509Certificate cert,
                 java.security.cert.X509Certificate caCert,
                 boolean issuerSerial)
          throws java.security.NoSuchAlgorithmException,
                 java.security.cert.CertificateEncodingException
Creates a new ESSCertID for the specified certificate.

Note the changes in the method signature

Previously public ESSCertID( X509 , X509 , boolean )

Now public ESSCertID(X509Certificate , X509Certificate , boolean)

Note the changes in the exceptions thrown

Exceptions no longer thrown -- AlgorithmIdentifierException

Exceptions introduced -- NoSuchAlgorithmException,CertificateEncodingException

Parameters:
cert - The X509 certificate.
caCert - The issuer's X509 certificate.
issuerSerial - If true, the issuerSerial of the certificate is added.
Throws:
java.security.NoSuchAlgorithmException - An error occurred during certificate hash generation.
java.security.cert.CertificateEncodingException - Error while encoding the certificate

ESSCertID

public ESSCertID(java.io.InputStream is)
          throws java.io.IOException
Creates a new ESSCertID by reading from the input stream.
Parameters:
is - The input stream.
AlgorithmIdentifierException - If the input encoding is incorrect or an I/O error occurred.
Throws:
java.io.IOException

Method Detail

getCertHash

public byte[] getCertHash()
Returns the hash of the certificate represented by this ESSCertID object.
Returns:
A byte[] representing the hash of the certificate.

getGeneralNames

public oracle.security.crypto.cert.GeneralNames getGeneralNames()
Returns the list of the General Names of the issuer of the certificate represented by this ESSCertID object.
Returns:
A Vector containing GeneralName objects if present or null otherwise.

getSerialNo

public java.math.BigInteger getSerialNo()
Returns the serial number of the of the certificate represented by this ESSCertID object.
Returns:
The Serial Number if present or null otherwise.

compareTo

public boolean compareTo(java.security.cert.X509Certificate cert)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.cert.CertificateEncodingException
Compare this object with the ESSCertID object created from the given certificate. Only the Certificate Hashes are compared even if the IssuerSerial is present.

Note the changes in the method signature

Previouslypublic boolean compareTo (X509 )

Now public boolean compareTo (X509Certificate )

Note the changes in the exceptions thrown

Exceptions no longer thrown -- AlgorithmIdentifierException

Exceptions introduced -- NoSuchAlgorithmException,CertificateEncodingException

Parameters:
cert - A X509 certificate.
Returns:
true if this object was made from the specified certificate; false otherwise.
Throws:
java.security.NoSuchAlgorithmException - An error occurred during certificate hash generation.
java.security.cert.CertificateEncodingException - Error while encoding the certificate

compareTo

public boolean compareTo(java.security.cert.X509Certificate cert,
                         java.security.cert.X509Certificate caCert)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.cert.CertificateEncodingException
Compare this object with the ESSCertID object created from the two given certificates. Checks if the object is a ESSCertID object, if the certificate hash is the same. If the IssuerSerial is present, it checks the serial number and for any matching GeneralName.

Note the changes in the method signature

Previouslypublic boolean compareTo (X509 ,X509)

Now public boolean compareTo (X509Certificate ,X509Certificate )

Note the changes in the exceptions thrown

Exceptions no longer thrown -- AlgorithmIdentifierException,IOException

Exceptions introduced -- NoSuchAlgorithmException,CertificateEncodingException

Parameters:
cert - A X509 certificate.
caCert - The issuer's certificate.
Returns:
true if this object was made from these two certificates; false otherwise.
Throws:
java.security.NoSuchAlgorithmException - An error occurred during certificate hash generation.
java.security.cert.CertificateEncodingException - Error while encoding the certificate

containsIssuerSerial

public boolean containsIssuerSerial()
Indicates if the IssuerSerial is present.
Returns:
true if the IssuerSerial is present;false otherwise.

equals

public boolean equals(java.lang.Object o)
Compares this ESSCertID object to the given object.
Overrides:
equals in class java.lang.Object
Returns:
true if the objects are the same, false otherwise.

hashCode

public int hashCode()
Returns the hash code of this object.
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Initialize this object by reading the ESSCertID encoding from the specified input stream.
Specified by:
input in interface oracle.security.crypto.util.Streamable
Parameters:
is - The input stream.
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Output this object's encoding to the specified output stream.
Specified by:
output in interface oracle.security.crypto.util.Streamable
Parameters:
os - The output stream.
Throws:
java.io.IOException

length

public int length()
Returns the length of this object's encoding.
Specified by:
length in interface oracle.security.crypto.util.Streamable
Returns:
The length in bytes.

toString

public java.lang.String toString()
Returns information about this object.
Overrides:
toString in class java.lang.Object
Returns:
A string.

Skip navigation links

Oracle Security Developer Tools CMS Java API Reference
11g (11.1.1)

E10667-02


Copyright © 2005, 2009, Oracle. All rights reserved.