Methods Summary |
---|
public boolean | equals(java.lang.Object other)Compares the argument to the certificate, and returns {@code true} if they
represent the same object using a class specific comparison. The
implementation in Object returns {@code true} only if the argument is the
exact same object as the callee (==).
// obj equal to itself
if (this == other) {
return true;
}
if (other instanceof Certificate) {
try {
// check that encoded forms match
return Arrays.equals(this.getEncoded(),
((Certificate)other).getEncoded());
} catch (CertificateEncodingException e) {
throw new RuntimeException(e);
}
}
return false;
|
public abstract byte[] | getEncoded()Returns the encoded representation for this certificate.
|
public abstract java.security.PublicKey | getPublicKey()Returns the public key corresponding to this certificate.
|
public final java.lang.String | getType()Returns the certificate type.
return type;
|
public int | hashCode()Returns an integer hash code for the certificate. Any two objects which
return {@code true} when passed to {@code equals} must return the same
value for this method.
try {
byte[] encoded = getEncoded();
int hash = 0;
for (int i=0; i<encoded.length; i++) {
hash += i*encoded[i];
}
return hash;
} catch (CertificateEncodingException e) {
throw new RuntimeException(e);
}
|
public abstract java.lang.String | toString()Returns a string containing a concise, human-readable description of the
certificate.
|
public abstract void | verify(java.security.PublicKey key)Verifies that this certificate was signed with the given public key.
|
public abstract void | verify(java.security.PublicKey key, java.lang.String sigProvider)Verifies that this certificate was signed with the given public key. It
Uses the signature algorithm given by the provider.
|
protected java.lang.Object | writeReplace()Returns an alternate object to be serialized.
try {
return new CertificateRep(getType(), getEncoded());
} catch (CertificateEncodingException e) {
throw new NotSerializableException (
Messages.getString("security.66", e)); //$NON-NLS-1$
}
|