APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.provider.certpath

public Class CertId

extends Object
implements DerEncoder
Class Inheritance
All Implemented Interfaces
sun.security.util.DerEncoder
Imports
java.io.IOException, java.math.BigInteger, java.security.MessageDigest, .NoSuchAlgorithmException, .PublicKey, java.security.cert.X509Certificate, java.util.Arrays, javax.security.auth.x500.X500Principal, sun.security.util.HexDumpEncoder, sun.security.util.*, sun.security.x509.*

This class corresponds to the CertId field in OCSP Request and the OCSP Response. The ASN.1 definition for CertID is defined in RFC 2560 as:

CertID          ::=     SEQUENCE {
     hashAlgorithm       AlgorithmIdentifier,
     issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
     issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
     serialNumber        CertificateSerialNumber
     }

Author
Ram Marti

Field Summary

Modifier and TypeField and Description
private final SerialNumber
private static final boolean
private final AlgorithmId
private final byte[]
private final byte[]
private int
private static final AlgorithmId

Constructor Summary

AccessConstructor and Description
public
CertId(X509Certificate issuerCert, SerialNumber serialNumber)

Creates a CertId.

public
CertId(X500Principal issuerName, PublicKey issuerKey, SerialNumber serialNumber)

public
CertId(DerInputStream derIn)

Creates a CertId from its ASN.1 DER encoding.

Method Summary

Modifier and TypeMethod and Description
public void
encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Encode the CertId using ASN.1 DER.

public boolean

Returns:

true if the objects are considered equal, false otherwise.
equals
(Object
the object to test for equality with this object.
other
)

Overrides java.lang.Object.equals.

Compares this CertId for equality with the specified object.

public AlgorithmId
getHashAlgorithm()

Return the hash algorithm identifier.

public byte[]
getIssuerKeyHash()

Return the hash value for the issuer key.

public byte[]
getIssuerNameHash()

Return the hash value for the issuer name.

public BigInteger
getSerialNumber()

Return the serial number.

public int

Returns:

a hashcode value for this CertId
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this CertId.

public String
toString()

Overrides java.lang.Object.toString.

Create a string representation of the CertId.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

certSerialNumberback to summary
private final SerialNumber certSerialNumber
debugback to summary
private static final boolean debug
hashAlgIdback to summary
private final AlgorithmId hashAlgId
issuerKeyHashback to summary
private final byte[] issuerKeyHash
issuerNameHashback to summary
private final byte[] issuerNameHash
myhashback to summary
private int myhash
SHA1_ALGIDback to summary
private static final AlgorithmId SHA1_ALGID

Constructor Detail

CertIdback to summary
public CertId(X509Certificate issuerCert, SerialNumber serialNumber) throws IOException

Creates a CertId. The hash algorithm used is SHA-1.

CertIdback to summary
public CertId(X500Principal issuerName, PublicKey issuerKey, SerialNumber serialNumber) throws IOException
CertIdback to summary
public CertId(DerInputStream derIn) throws IOException

Creates a CertId from its ASN.1 DER encoding.

Method Detail

encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Encode the CertId using ASN.1 DER. The hash algorithm used is SHA-1.

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compares this CertId for equality with the specified object. Two CertId objects are considered equal if their hash algorithms, their issuer name and issuer key hash values and their serial numbers are equal.

Parameters
other:Object

the object to test for equality with this object.

Returns:boolean

true if the objects are considered equal, false otherwise.

Annotations
@Override
getHashAlgorithmback to summary
public AlgorithmId getHashAlgorithm()

Return the hash algorithm identifier.

getIssuerKeyHashback to summary
public byte[] getIssuerKeyHash()

Return the hash value for the issuer key.

getIssuerNameHashback to summary
public byte[] getIssuerNameHash()

Return the hash value for the issuer name.

getSerialNumberback to summary
public BigInteger getSerialNumber()

Return the serial number.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this CertId.

Returns:int

a hashcode value for this CertId

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Create a string representation of the CertId.

Annotations
@Override