iaik.security.ssl
Class KeyAndCert

java.lang.Object
  |
  +--iaik.security.ssl.KeyAndCert

public class KeyAndCert
extends java.lang.Object
implements java.lang.Cloneable

This class stores a key and the corresponding certificate chain. It is used throughout the library whenever credentials are needed. The certificate chain must contain the end entity certificate at index 0.


Constructor Summary
KeyAndCert(X509Certificate[] chain, PrivateKey privateKey)
          Create a new KeyAndCert object.
 
Method Summary
 java.lang.Object clone()
          Get a clone of this object.
 boolean equals(java.lang.Object obj)
          Test two objects for equality.
 X509Certificate[] getCertificateChain()
          Get the certificate chain.
 int getCertificateType()
          Get the certificate type.
 PrivateKey getPrivateKey()
          Get the private key.
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyAndCert

public KeyAndCert(X509Certificate[] chain,
                  PrivateKey privateKey)
Create a new KeyAndCert object. Both arguments must be non-null and the chain has to consist of at least one element.
Method Detail

getPrivateKey

public final PrivateKey getPrivateKey()
Get the private key.

getCertificateChain

public final X509Certificate[] getCertificateChain()
Get the certificate chain.

getCertificateType

public final int getCertificateType()
Get the certificate type. It will be one of the constants defined in SSLContext.
See Also:
SSLContext.CERTTYPE_RSA_SIGN

equals

public boolean equals(java.lang.Object obj)
Test two objects for equality.
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Get a clone of this object.
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Return a string representation of this object.
Overrides:
toString in class java.lang.Object