Home » openjdk-7 » java » security » cert » [javadoc | source]
java.security.cert
abstract public class: Certificate [javadoc | source]
java.lang.Object
   java.security.cert.Certificate

All Implemented Interfaces:
    java$io$Serializable

Direct Known Subclasses:
    X509Certificate

Abstract class for managing a variety of identity certificates. An identity certificate is a binding of a principal to a public key which is vouched for by another principal. (A principal represents an entity such as an individual user, a group, or a corporation.)

This class is an abstraction for certificates that have different formats but important common uses. For example, different types of certificates, such as X.509 and PGP, share general certificate functionality (like encoding and verifying) and some types of information (like a public key).

X.509, PGP, and SDSI certificates can all be implemented by subclassing the Certificate class, even though they contain different sets of information, and they store and retrieve the information in different ways.

Nested Class Summary:
protected static class  Certificate.CertificateRep  Alternate Certificate class for serialization. 
Constructor:
 protected Certificate(String type) 
    Creates a certificate of the specified type.
Method from java.security.cert.Certificate Summary:
equals,   getEncoded,   getPublicKey,   getType,   hashCode,   toString,   verify,   verify,   writeReplace
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.security.cert.Certificate Detail:
 public boolean equals(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.
 abstract public byte[] getEncoded() throws CertificateEncodingException
    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.
 abstract public PublicKey getPublicKey()
    Gets the public key from this certificate.
 public final String getType() 
    Returns the type of this certificate.
 public int hashCode() 
    Returns a hashcode value for this certificate from its encoded form.
 abstract public String toString()
    Returns a string representation of this certificate.
 abstract public  void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
    Verifies that this certificate was signed using the private key that corresponds to the specified public key.
 abstract public  void verify(PublicKey key,
    String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
    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 Object writeReplace() throws ObjectStreamException 
    Replace the Certificate to be serialized.