public class

X509CertificatePair

extends Object
java.lang.Object
   ↳ sun.security.provider.certpath.X509CertificatePair

Class Overview

This class represents an X.509 Certificate Pair object, which is primarily used to hold a pair of cross certificates issued between Certification Authorities. The ASN.1 structure is listed below. The forward certificate of the CertificatePair contains a certificate issued to this CA by another CA. The reverse certificate of the CertificatePair contains a certificate issued by this CA to another CA. When both the forward and the reverse certificates are present in the CertificatePair, the issuer name in one certificate shall match the subject name in the other and vice versa, and the subject public key in one certificate shall be capable of verifying the digital signature on the other certificate and vice versa. If a subject public key in one certificate does not contain required key algorithm parameters, then the signature check involving that key is not done.

The ASN.1 syntax for this object is:

 CertificatePair      ::=     SEQUENCE {
      forward [0]     Certificate OPTIONAL,
      reverse [1]     Certificate OPTIONAL
                      -- at least one of the pair shall be present -- }
 

This structure uses EXPLICIT tagging. References: Annex A of X.509(2000), X.509(1997).

Summary

Public Constructors
X509CertificatePair()
Creates an empty instance of X509CertificatePair.
X509CertificatePair(X509Certificate forward, X509Certificate reverse)
Creates an instance of X509CertificatePair.
Public Methods
synchronized static void clearCache()
Clear the cache for debugging.
synchronized static X509CertificatePair generateCertificatePair(byte[] encoded)
Create a X509CertificatePair from its encoding.
byte[] getEncoded()
Return the DER encoded form of the certificate pair.
X509Certificate getForward()
Returns the forward component of the certificate pair.
X509Certificate getReverse()
Returns the reverse component of the certificate pair.
void setForward(X509Certificate cert)
Sets the forward component of the certificate pair.
void setReverse(X509Certificate cert)
Sets the reverse component of the certificate pair.
String toString()
Return a printable representation of the certificate pair.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public X509CertificatePair ()

Creates an empty instance of X509CertificatePair.

public X509CertificatePair (X509Certificate forward, X509Certificate reverse)

Creates an instance of X509CertificatePair. At least one of the pair must be non-null.

Parameters
forward The forward component of the certificate pair which represents a certificate issued to this CA by other CAs.
reverse The reverse component of the certificate pair which represents a certificate issued by this CA to other CAs.
Throws
CertificateException If an exception occurs.

Public Methods

public static synchronized void clearCache ()

Clear the cache for debugging.

public static synchronized X509CertificatePair generateCertificatePair (byte[] encoded)

Create a X509CertificatePair from its encoding. Uses cache lookup if possible.

public byte[] getEncoded ()

Return the DER encoded form of the certificate pair.

Returns
  • The encoded form of the certificate pair.
Throws
If an encoding exception occurs.
CertificateEncodingException

public X509Certificate getForward ()

Returns the forward component of the certificate pair.

Returns
  • The forward certificate, or null if not set.

public X509Certificate getReverse ()

Returns the reverse component of the certificate pair.

Returns
  • The reverse certificate, or null if not set.

public void setForward (X509Certificate cert)

Sets the forward component of the certificate pair.

public void setReverse (X509Certificate cert)

Sets the reverse component of the certificate pair.

public String toString ()

Return a printable representation of the certificate pair.

Returns
  • A String describing the contents of the pair.