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

public Class X509CertificatePair

extends Object
Class Inheritance
Imports
java.io.IOException, java.security.GeneralSecurityException, .PublicKey, java.security.cert.CertificateEncodingException, .CertificateException, .X509Certificate, java.security.interfaces.DSAPublicKey, javax.security.auth.x500.X500Principal, sun.security.util.DerOutputStream, .DerValue, .Cache, sun.security.x509.X509CertImpl, sun.security.provider.X509Factory

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).

Author
Sean Mullan
Since
1.4

Field Summary

Modifier and TypeField and Description
private static final Cache<Object, X509CertificatePair>
private byte[]
private X509Certificate
private X509Certificate
private static final byte
private static final byte

Constructor Summary

AccessConstructor and Description
public
X509CertificatePair()

Creates an empty instance of X509CertificatePair.

public
X509CertificatePair(X509Certificate
The forward component of the certificate pair which represents a certificate issued to this CA by other CAs.
forward
,
X509Certificate
The reverse component of the certificate pair which represents a certificate issued by this CA to other CAs.
reverse
)

Creates an instance of X509CertificatePair.

private
X509CertificatePair(byte[] encoded)

Create a new X509CertificatePair from its encoding.

Method Summary

Modifier and TypeMethod and Description
private void
public static synchronized void
clearCache()

Clear the cache for debugging.

private void
public static synchronized X509CertificatePair
generateCertificatePair(byte[] encoded)

Create a X509CertificatePair from its encoding.

public byte[]

Returns:

The encoded form of the certificate pair.
getEncoded
()

Return the DER encoded form of the certificate pair.

public X509Certificate

Returns:

The forward certificate, or null if not set.
getForward
()

Returns the forward component of the certificate pair.

public X509Certificate

Returns:

The reverse certificate, or null if not set.
getReverse
()

Returns the reverse component of the certificate pair.

private void
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

Returns:

A String describing the contents of the pair.
toString
()

Overrides java.lang.Object.toString.

Return a printable representation of the certificate pair.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cacheback to summary
private static final Cache<Object, X509CertificatePair> cache
encodedback to summary
private byte[] encoded
forwardback to summary
private X509Certificate forward
reverseback to summary
private X509Certificate reverse
TAG_FORWARDback to summary
private static final byte TAG_FORWARD
TAG_REVERSEback to summary
private static final byte TAG_REVERSE

Constructor Detail

X509CertificatePairback to summary
public X509CertificatePair()

Creates an empty instance of X509CertificatePair.

X509CertificatePairback to summary
public X509CertificatePair(X509Certificate forward, X509Certificate reverse) throws CertificateException

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

Parameters
forward:X509Certificate

The forward component of the certificate pair which represents a certificate issued to this CA by other CAs.

reverse:X509Certificate

The reverse component of the certificate pair which represents a certificate issued by this CA to other CAs.

Exceptions
CertificateException:
If an exception occurs.
X509CertificatePairback to summary
private X509CertificatePair(byte[] encoded) throws CertificateException

Create a new X509CertificatePair from its encoding. For internal use only, external code should use generateCertificatePair.

Method Detail

checkPairback to summary
private void checkPair() throws CertificateException
clearCacheback to summary
public static synchronized void clearCache()

Clear the cache for debugging.

emitback to summary
private void emit(DerOutputStream out) throws IOException, CertificateEncodingException
generateCertificatePairback to summary
public static synchronized X509CertificatePair generateCertificatePair(byte[] encoded) throws CertificateException

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

getEncodedback to summary
public byte[] getEncoded() throws CertificateEncodingException

Return the DER encoded form of the certificate pair.

Returns:byte[]

The encoded form of the certificate pair.

Exceptions
CertificateEncodingException:
If an encoding exception occurs.
getForwardback to summary
public X509Certificate getForward()

Returns the forward component of the certificate pair.

Returns:X509Certificate

The forward certificate, or null if not set.

getReverseback to summary
public X509Certificate getReverse()

Returns the reverse component of the certificate pair.

Returns:X509Certificate

The reverse certificate, or null if not set.

parseback to summary
private void parse(DerValue val) throws IOException, CertificateException
setForwardback to summary
public void setForward(X509Certificate cert) throws CertificateException

Sets the forward component of the certificate pair.

setReverseback to summary
public void setReverse(X509Certificate cert) throws CertificateException

Sets the reverse component of the certificate pair.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a printable representation of the certificate pair.

Returns:String

A String describing the contents of the pair.

Annotations
@Override