public abstract class Certificate extends Object
Note: This package is provided only for compatibility reasons. It contains a simplified version of the java.security.cert package that was previously used by JSSE (Java SSL package). All applications that do not have to be compatible with older versions of JSSE (that is before Java SDK 1.5) should only use java.security.cert.
| Constructor and Description |
|---|
Certificate()
Creates a new
Certificate. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares the argument to this Certificate.
|
abstract byte[] |
getEncoded()
Returns the encoded representation for this certificate.
|
abstract PublicKey |
getPublicKey()
Returns the public key corresponding to this certificate.
|
int |
hashCode()
Returns an integer hash code for the receiver.
|
abstract String |
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
abstract void |
verify(PublicKey key)
Verifies that this certificate was signed with the given public key.
|
abstract void |
verify(PublicKey key,
String sigProvider)
Verifies that this certificate was signed with the given public key.
|
public boolean equals(Object obj)
equals in class Objectobj - the Certificate to compare with this objecttrue if obj is the same as this
Certificate, false otherwisehashCode()public int hashCode()
true when passed to equals must answer
the same value for this method.hashCode in class Objectequals(java.lang.Object)public abstract byte[] getEncoded()
throws CertificateEncodingException
CertificateEncodingException - if encoding fails.public abstract void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
key - public key for which verification should be performed.CertificateException - if encoding errors are detectedNoSuchAlgorithmException - if an unsupported algorithm is detectedInvalidKeyException - if an invalid key is detectedNoSuchProviderException - if there is no default providerSignatureException - if signature errors are detectedpublic abstract void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
key - public key for which verification should be performed.sigProvider - the name of the signature provider.CertificateException - if encoding errors are detectedNoSuchAlgorithmException - if an unsupported algorithm is detectedInvalidKeyException - if an invalid key is detectedNoSuchProviderException - if the specified provider does not exists.SignatureException - if signature errors are detectedpublic abstract String toString()
public abstract PublicKey getPublicKey()