java.security.cert
Class Certificate
java.lang.Object
|
+--java.security.cert.Certificate
public abstract class
Certificateextends
ObjectThe Certificate class is an abstract class used to manage
identity certificates. An identity certificate is a
combination of a principal and a public key which is
certified by another principal. This is the puprose of
Certificate Authorities (CA).
This class is used to manage different types of certificates
but have important common puposes. Different types of
certificates like X.509 and OpenPGP share general certificate
functions (like encoding and verifying) and information like
public keys.
X.509, OpenPGP, and SDSI can be implemented by subclassing this
class even though they differ in storage methods and information
stored.
Since:Author:Certificate
protected Certificate(java.lang.String type)
Constructs a new certificate of the specified type. An example
is "X.509".
Parameters:
equals
public boolean equals(java.lang.Object other)
Compares this Certificate to other. It checks if the
object if instanceOf Certificate and then checks if
the encoded form matches.
Parameters:
Returns:
- true if equal, false otherwise
getEncoded
public byte[] getEncoded()
Gets the DER ASN.1 encoded format for this Certificate.
It assumes each certificate has only one encoding format.
Ex: X.509 is encoded as ASN.1 DER
Returns:
- byte array containg encoded form
Throws:
getPublicKey
public PublicKey getPublicKey()
Returns the public key stored in the Certificate.
Returns:
getType
public final String getType()
Returns the Certificate type.
Returns:
- a string representing the Certificate type
hashCode
public int hashCode()
Returns a hash code for this Certificate in its encoded
form.
Returns:
- A hash code of this class
toString
public String toString()
Returns a string representing the Certificate.
Returns:
- a string representing the Certificate.
verify
public void verify(java.security.PublicKey key)
Verifies that this Certificate was properly signed with the
PublicKey that corresponds to its private key.
Parameters:
Throws:
verify
public void verify(java.security.PublicKey key, java.lang.String sigProvider)
Verifies that this Certificate was properly signed with the
PublicKey that corresponds to its private key and uses
the signature engine provided by the provider.
Parameters:
Throws: