Skip navigation links

Oracle Fusion Middleware PKI SDK OCSP Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10673-01


oracle.security.crypto.ocsp
Class CertID

java.lang.Object
  extended by oracle.security.crypto.ocsp.CertID

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

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

Represents the certID of a certificate in OCSP.


Constructor Summary
CertID(java.io.InputStream is)
           
CertID(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert)
          Creates a new CertID for the specified certificate having the specified issuing CA certificate, using the default hash algorithm (SHA1).
CertID(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Creates a new CertID for the specified certificate having the specified issuing CA certificate, using the given hash algorithm.

 

Method Summary
 boolean compareTo(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert)
          Compare this object with the CertID object created from the two given certificates.
 boolean compareTo(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Compare this object with the CertID object created from the two given certificates, using the given algorithm to compute the digest.
 boolean equals(java.lang.Object o)
          Compares this CertID object to the given object.
 oracle.security.crypto.core.AlgorithmIdentifier getHashAlgID()
          Gets the AlgorithmIdentifier used to hash the name and the public key of the CA.
 byte[] getIssuerKeyHash()
          Returns the hash of the issuer's public key.
 byte[] getIssuerNameHash()
          Returns the hash of the issuer's name.
 java.math.BigInteger getSerialNo()
          Returns the serial number of the of the certificate represented by this certID object.
 int hashCode()
           
 void input(java.io.InputStream is)
           
 int length()
           
 void output(java.io.OutputStream os)
          Output to the specified output stream.
 java.lang.String toString()
           

 

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

 

Constructor Detail

CertID

public CertID(java.security.cert.X509Certificate cert,
              java.security.cert.X509Certificate caCert)
       throws java.security.NoSuchAlgorithmException,
              java.security.cert.CertificateEncodingException
Creates a new CertID for the specified certificate having the specified issuing CA certificate, using the default hash algorithm (SHA1).

Note the changes in the method signature

Previously public CertID (X509 , X509 )

Now public CertID (X509Certificate , X509Certificate )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

CertID

public CertID(java.security.cert.X509Certificate cert,
              java.security.cert.X509Certificate caCert,
              oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
       throws java.security.NoSuchAlgorithmException,
              java.security.cert.CertificateEncodingException
Creates a new CertID for the specified certificate having the specified issuing CA certificate, using the given hash algorithm.

Note the changes in the method signature

Previously public CertID (X509 , X509 ,AlgorithmIdentifier)

Now public CertID (X509Certificate , X509Certificate,AlgorithmIdentifier )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

CertID

public CertID(java.io.InputStream is)
       throws java.io.IOException
Throws:
java.io.IOException

Method Detail

getHashAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getHashAlgID()
Gets the AlgorithmIdentifier used to hash the name and the public key of the CA.
Returns:
An AlgoritmIdentifier object representing the digest function used.

getIssuerNameHash

public byte[] getIssuerNameHash()
Returns the hash of the issuer's name.
Returns:
A byte[] representing the hash of the issuer's GeneralName.

getIssuerKeyHash

public byte[] getIssuerKeyHash()
Returns the hash of the issuer's public key.
Returns:
A byte[].

getSerialNo

public java.math.BigInteger getSerialNo()
Returns the serial number of the of the certificate represented by this certID object.
Returns:
A BigInteger representing a SerialNo.

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 CertID object created from the two given certificates. The hash algorithm will be SHA1 by default.

Note the changes in the method signature

Previously public boolean compareTo (X509, X509)

Now public boolean compareTo (X509Certificate, X509Certificate)

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException

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
java.security.cert.CertificateEncodingException

compareTo

public boolean compareTo(java.security.cert.X509Certificate cert,
                         java.security.cert.X509Certificate caCert,
                         oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.cert.CertificateEncodingException
Compare this object with the CertID object created from the two given certificates, using the given algorithm to compute the digest.

Note the changes in the method signature

Previously public boolean compareTo (X509, X509,AlgorithmIdentifier)

Now public boolean compareTo (X509Certificate, X509Certificate,AlgorithmIdentifier)

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Parameters:
cert - A X509 certificate.
caCert - The issuer's certificate.
hashAlgID - The AlgorithmIdentifier to use to compute the digests.
Returns:
true if this object was made from these two certificates, false otherwise.
Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

equals

public boolean equals(java.lang.Object o)
Compares this CertID object to the given object. Checks if the object is a CertID object, if the hash algorithms are the same and if the digests and serial number are the same.
Overrides:
equals in class java.lang.Object
Returns:
true if the objects are the same, false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Specified by:
input in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Output to the specified output stream.
Specified by:
output in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

length

public int length()
Specified by:
length in interface oracle.security.crypto.util.Streamable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware PKI SDK OCSP Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10673-01


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