Methods Summary |
---|
public boolean | equals(java.lang.Object other)Compares this certificate for equality with the specified
object. If the other object is an
instanceof Certificate , then
its encoded form is retrieved and compared with the
encoded form of this certificate.
if (this == other) {
return true;
}
if (!(other instanceof Certificate)) {
return false;
}
try {
byte[] thisCert = X509CertImpl.getEncodedInternal(this);
byte[] otherCert = X509CertImpl.getEncodedInternal((Certificate)other);
return Arrays.equals(thisCert, otherCert);
} catch (CertificateException e) {
return false;
}
|
public abstract byte[] | getEncoded()Returns the encoded form of this certificate. It is
assumed that each certificate type would have only a single
form of encoding; for example, X.509 certificates would
be encoded as ASN.1 DER.
|
public abstract java.security.PublicKey | getPublicKey()Gets the public key from this certificate.
|
public final java.lang.String | getType()Returns the type of this certificate.
return this.type;
|
public int | hashCode()Returns a hashcode value for this certificate from its
encoded form.
int retval = 0;
try {
byte[] certData = X509CertImpl.getEncodedInternal(this);
for (int i = 1; i < certData.length; i++) {
retval += certData[i] * i;
}
return retval;
} catch (CertificateException e) {
return retval;
}
|
public abstract java.lang.String | toString()Returns a string representation of this certificate.
|
public abstract void | verify(java.security.PublicKey key)Verifies that this certificate was signed using the
private key that corresponds to the specified public key.
|
public abstract void | verify(java.security.PublicKey key, java.lang.String sigProvider)Verifies that this certificate was signed using the
private key that corresponds to the specified public key.
This method uses the signature verification engine
supplied by the specified provider.
|
protected java.lang.Object | writeReplace()Replace the Certificate to be serialized.
try {
return new CertificateRep(type, getEncoded());
} catch (CertificateException e) {
throw new java.io.NotSerializableException
("java.security.cert.Certificate: " +
type +
": " +
e.getMessage());
}
|