java.security
Interface Certificate


Deprecated. A new certificate handling package is created in the Java 2 platform. This Certificate interface is entirely deprecated and is here to allow for a smooth transition to the new package.

@Deprecated
public interface Certificate

This is an interface of abstract methods for managing a variety of identity certificates. An identity certificate is a guarantee by a principal that a public key is that of another principal. (A principal represents an entity such as an individual user, a group, or a corporation.)

In particular, this interface is intended to be a common abstraction for constructs that have different formats but important common uses. For example, different types of certificates, such as X.509 certificates and PGP certificates, share general certificate functionality (the need to encode and decode certificates) and some types of information, such as a public key, the principal whose key it is, and the guarantor guaranteeing that the public key is that of the specified principal. So an implementation of X.509 certificates and an implementation of PGP certificates can both utilize the Certificate interface, even though their formats and additional types and amounts of information stored are different.

Important: This interface is useful for cataloging and grouping objects sharing certain common uses. It does not have any semantics of its own. In particular, a Certificate object does not make any statement as to the validity of the binding. It is the duty of the application implementing this interface to verify the certificate and satisfy itself of its validity.

See Also:
Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate

Method Summary
 void decode sample code for java.security.Certificate.decode(java.io.InputStream) definition code for java.security.Certificate.decode(java.io.InputStream) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  stream)
          Deprecated. Decodes a certificate from an input stream.
 void encode sample code for java.security.Certificate.encode(java.io.OutputStream) definition code for java.security.Certificate.encode(java.io.OutputStream) (OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  stream)
          Deprecated. Encodes the certificate to an output stream in a format that can be decoded by the decode method.
 String sample code for java.lang.String definition code for java.lang.String getFormat sample code for java.security.Certificate.getFormat() definition code for java.security.Certificate.getFormat() ()
          Deprecated. Returns the name of the coding format.
 Principal sample code for java.security.Principal definition code for java.security.Principal getGuarantor sample code for java.security.Certificate.getGuarantor() definition code for java.security.Certificate.getGuarantor() ()
          Deprecated. Returns the guarantor of the certificate, that is, the principal guaranteeing that the public key associated with this certificate is that of the principal associated with this certificate.
 Principal sample code for java.security.Principal definition code for java.security.Principal getPrincipal sample code for java.security.Certificate.getPrincipal() definition code for java.security.Certificate.getPrincipal() ()
          Deprecated. Returns the principal of the principal-key pair being guaranteed by the guarantor.
 PublicKey sample code for java.security.PublicKey definition code for java.security.PublicKey getPublicKey sample code for java.security.Certificate.getPublicKey() definition code for java.security.Certificate.getPublicKey() ()
          Deprecated. Returns the key of the principal-key pair being guaranteed by the guarantor.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.security.Certificate.toString(boolean) definition code for java.security.Certificate.toString(boolean) (boolean detailed)
          Deprecated. Returns a string that represents the contents of the certificate.
 

Method Detail

getGuarantor sample code for java.security.Certificate.getGuarantor() definition code for java.security.Certificate.getGuarantor()

Principal sample code for java.security.Principal definition code for java.security.Principal  getGuarantor()
Deprecated. 
Returns the guarantor of the certificate, that is, the principal guaranteeing that the public key associated with this certificate is that of the principal associated with this certificate. For X.509 certificates, the guarantor will typically be a Certificate Authority (such as the United States Postal Service or Verisign, Inc.).

Returns:
the guarantor which guaranteed the principal-key binding.

getPrincipal sample code for java.security.Certificate.getPrincipal() definition code for java.security.Certificate.getPrincipal()

Principal sample code for java.security.Principal definition code for java.security.Principal  getPrincipal()
Deprecated. 
Returns the principal of the principal-key pair being guaranteed by the guarantor.

Returns:
the principal to which this certificate is bound.

getPublicKey sample code for java.security.Certificate.getPublicKey() definition code for java.security.Certificate.getPublicKey()

PublicKey sample code for java.security.PublicKey definition code for java.security.PublicKey  getPublicKey()
Deprecated. 
Returns the key of the principal-key pair being guaranteed by the guarantor.

Returns:
the public key that this certificate certifies belongs to a particular principal.

encode sample code for java.security.Certificate.encode(java.io.OutputStream) definition code for java.security.Certificate.encode(java.io.OutputStream)

void encode(OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  stream)
            throws KeyException sample code for java.security.KeyException definition code for java.security.KeyException ,
                   IOException sample code for java.io.IOException definition code for java.io.IOException 
Deprecated. 
Encodes the certificate to an output stream in a format that can be decoded by the decode method.

Parameters:
stream - the output stream to which to encode the certificate.
Throws:
KeyException sample code for java.security.KeyException definition code for java.security.KeyException - if the certificate is not properly initialized, or data is missing, etc.
IOException sample code for java.io.IOException definition code for java.io.IOException - if a stream exception occurs while trying to output the encoded certificate to the output stream.
See Also:
decode(java.io.InputStream) sample code for java.security.Certificate.decode(java.io.InputStream) definition code for java.security.Certificate.decode(java.io.InputStream) , getFormat() sample code for java.security.Certificate.getFormat() definition code for java.security.Certificate.getFormat()

decode sample code for java.security.Certificate.decode(java.io.InputStream) definition code for java.security.Certificate.decode(java.io.InputStream)

void decode(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  stream)
            throws KeyException sample code for java.security.KeyException definition code for java.security.KeyException ,
                   IOException sample code for java.io.IOException definition code for java.io.IOException 
Deprecated. 
Decodes a certificate from an input stream. The format should be that returned by getFormat and produced by encode.

Parameters:
stream - the input stream from which to fetch the data being decoded.
Throws:
KeyException sample code for java.security.KeyException definition code for java.security.KeyException - if the certificate is not properly initialized, or data is missing, etc.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an exception occurs while trying to input the encoded certificate from the input stream.
See Also:
encode(java.io.OutputStream) sample code for java.security.Certificate.encode(java.io.OutputStream) definition code for java.security.Certificate.encode(java.io.OutputStream) , getFormat() sample code for java.security.Certificate.getFormat() definition code for java.security.Certificate.getFormat()

getFormat sample code for java.security.Certificate.getFormat() definition code for java.security.Certificate.getFormat()

String sample code for java.lang.String definition code for java.lang.String  getFormat()
Deprecated. 
Returns the name of the coding format. This is used as a hint to find an appropriate parser. It could be "X.509", "PGP", etc. This is the format produced and understood by the encode and decode methods.

Returns:
the name of the coding format.

toString sample code for java.security.Certificate.toString(boolean) definition code for java.security.Certificate.toString(boolean)

String sample code for java.lang.String definition code for java.lang.String  toString(boolean detailed)
Deprecated. 
Returns a string that represents the contents of the certificate.

Parameters:
detailed - whether or not to give detailed information about the certificate
Returns:
a string representing the contents of the certificate