javax.security.cert

Class Certificate

Known Direct Subclasses:
X509Certificate

public abstract class Certificate
extends java.lang.Object

The base class for public-key certificates.

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

NOTE: This package is deprecated. Use java.security.cert.Certificate instead.

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.

Constructor Details

Certificate

public Certificate()

Method Details

equals

public boolean equals(Object other)
Tests if this certificate equals another.
Parameters:
other - The object to test.
Returns:
True if the certificates are equal.

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.

getPublicKey

public abstract PublicKey getPublicKey()
Returns this certificate's public key.
Returns:
The public key.

hashCode

public int hashCode()
Computes a hash code for this certificate.
Returns:
The hash code.

toString

public abstract String toString()
Returns a printable representation of this certificate.
Returns:
The string.

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.

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.