public abstract class Certificate extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Certificate.CertificateRep
The alternate
Serializable class to be used for serialization and
deserialization of Certificate objects. |
| Modifier | Constructor and Description |
|---|---|
protected |
Certificate(String type)
Creates a new
Certificate with the specified type. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Compares the argument to the certificate, and returns
true if they
represent the same object using a class specific comparison. |
abstract byte[] |
getEncoded()
Returns the encoded representation for this certificate.
|
abstract PublicKey |
getPublicKey()
Returns the public key corresponding to this certificate.
|
String |
getType()
Returns the certificate type.
|
int |
hashCode()
Returns an integer hash code for the certificate.
|
abstract String |
toString()
Returns a string containing a concise, human-readable description of the
certificate.
|
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.
|
protected Object |
writeReplace()
Returns an alternate object to be serialized.
|
protected Certificate(String type)
Certificate with the specified type.type - the certificate type.public final String getType()
public boolean equals(Object other)
true if they
represent the same object using a class specific comparison. The
implementation in Object returns true only if the argument is the
exact same object as the callee (==).equals in class Objectother - the object to compare with this object.true if the object is the same as this object, false if it is different from this object.hashCode()public int hashCode()
true when passed to equals must return the same
value for this method.hashCode in class Objectequals(java.lang.Object)public abstract byte[] getEncoded()
throws CertificateEncodingException
CertificateEncodingException - if the encoding fails.public abstract void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
key - PublicKey public key for which verification should be
performed.CertificateException - if encoding errors are detected.NoSuchAlgorithmException - if an unsupported algorithm is detected.InvalidKeyException - if an invalid key is detected.NoSuchProviderException - if there is no default provider.SignatureException - if signature errors are detected.public abstract void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
key - PublicKey public key for which verification should be
performed.sigProvider - String the name of the signature provider.CertificateException - if encoding errors are detected.NoSuchAlgorithmException - if an unsupported algorithm is detected.InvalidKeyException - if an invalid key is detected.NoSuchProviderException - if the specified provider does not exists.SignatureException - if signature errors are detected.public abstract String toString()
public abstract PublicKey getPublicKey()
protected Object writeReplace() throws ObjectStreamException
ObjectStreamException - if the creation of the alternate object fails.