javax.security.cert
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 and Description |
---|
Certificate() |
Modifier and Type | Method and Description |
---|---|
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.
|
public Certificate()
public boolean equals(Object other)
Tests if this certificate equals another.
equals
in class Object
other
- The object to test.Object.hashCode()
public int hashCode()
Computes a hash code for this certificate.
hashCode
in class Object
Object.equals(Object)
,
System.identityHashCode(Object)
public abstract byte[] getEncoded() throws CertificateEncodingException
Return the encoded form of this certificate.
CertificateEncodingException
- If the certificate could not be
encoded.public abstract void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
Verifies the signature of this certificate.
key
- The signer's public key.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.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.
key
- The signer's public key.sigProvider
- The name of the signature provider.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.public abstract String toString()
Returns a printable representation of this certificate.
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
public abstract PublicKey getPublicKey()
Returns this certificate's public key.