javax.security.cert

Class Certificate

public abstract class Certificate extends Object

The base class for public-key certificates.

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

Constructor Summary
Certificate()
Method Summary
booleanequals(Object other)

Tests if this certificate equals another.

abstract byte[]getEncoded()

Return the encoded form of this certificate.

abstract PublicKeygetPublicKey()

Returns this certificate's public key.

inthashCode()

Computes a hash code for this certificate.

abstract StringtoString()

Returns a printable representation of this certificate.

abstract voidverify(PublicKey key)

Verifies the signature of this certificate.

abstract voidverify(PublicKey key, String sigProvider)

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

Constructor Detail

Certificate

public Certificate()

Method Detail

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

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)

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)

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.