javax.security.cert
Class Certificate

java.lang.Object
  extended by javax.security.cert.Certificate
Direct Known Subclasses:
X509Certificate

public abstract class Certificate
extends Object

The base class for public-key certificates.

This class is deprecated in favor of the Certificate class. It should not be used in new applications.


Constructor Summary
Certificate()
           
 
Method Summary
 boolean equals(Object other)
          Tests if this certificate equals another.
abstract  byte[] getEncoded()
          Return the encoded form of this certificate.
abstract  PublicKey getPublicKey()
          Returns this certificate's public key.
 int hashCode()
          Computes a hash code for this certificate.
abstract  String toString()
          Returns a printable representation of this certificate.
abstract  void verify(PublicKey key)
          Verifies the signature of this certificate.
abstract  void verify(PublicKey key, String sigProvider)
          Verifies the signature of this certificate, using the specified security provider.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Certificate

public Certificate()
Method Detail

equals

public boolean equals(Object other)

Tests if this certificate equals another.

Overrides:
equals in class Object
Parameters:
other - The object to test.
Returns:
True if the certificates are equal.
See Also:
Object.hashCode()

hashCode

public int hashCode()

Computes a hash code for this certificate.

Overrides:
hashCode in class Object
Returns:
The hash code.
See Also:
Object.equals(Object), System.identityHashCode(Object)

getEncoded

public abstract byte[] getEncoded()
                           throws CertificateEncodingException

Return the encoded form of this certificate.

Returns:
The encoded form.
Throws:
CertificateEncodingException - If the certificate could not be encoded.

verify

public abstract void verify(PublicKey key)
                     throws CertificateException,
                            NoSuchAlgorithmException,
                            InvalidKeyException,
                            NoSuchProviderException,
                            SignatureException

Verifies the signature of this certificate.

Parameters:
key - The signer's public key.
Throws:
CertificateException
NoSuchAlgorithmException - If the algorithm used to sign the certificate is not available.
InvalidKeyException - If the supplied key is not appropriate for the certificate's signature algorithm.
NoSuchProviderException
SignatureException - If the signature could not be verified.

verify

public abstract void verify(PublicKey key,
                            String sigProvider)
                     throws CertificateException,
                            NoSuchAlgorithmException,
                            InvalidKeyException,
                            NoSuchProviderException,
                            SignatureException

Verifies the signature of this certificate, using the specified security provider.

Parameters:
key - The signer's public key.
sigProvider - The name of the signature provider.
Throws:
CertificateException
NoSuchAlgorithmException - If the algorithm used to sign the certificate is not available.
InvalidKeyException - If the supplied key is not appropriate for the certificate's signature algorithm.
NoSuchProviderException - If sigProvider is not the name of an installed provider.
SignatureException - If the signature could not be verified.

toString

public abstract String toString()

Returns a printable representation of this certificate.

Overrides:
toString in class Object
Returns:
The string.
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)

getPublicKey

public abstract PublicKey getPublicKey()

Returns this certificate's public key.

Returns:
The public key.