<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Interface java.security.Certificate
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.html">This Package</a>  <a href="Package-java.security.html">Previous</a>  <a href="java.security.Key.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface java.security.Certificate
</h1>
<dl>
  <dt> public interface <b>Certificate</b>
</dl>
<p>This is an interface of abstract methods for managing an
 identity certificate. 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 or a
 group.)
 <p>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.
 <p><b>Important</b>: 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 <i>validity</i> of the binding. It is
 the duty of the application implementing this interface to verify
 the certificate and satisfy itself of its validity.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#decode(java.io.InputStream)"><b>decode</b></a>(InputStream)
  <dd>  Decodes a certificate from an input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#encode(java.io.OutputStream)"><b>encode</b></a>(OutputStream)
  <dd>  Encodes the certificate to an output stream in a format that can
 be decoded by the <code>decode</code> method.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getFormat()"><b>getFormat</b></a>()
  <dd>  Returns the name of the coding format.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getGuarantor()"><b>getGuarantor</b></a>()
  <dd> 
 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.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getPrincipal()"><b>getPrincipal</b></a>()
  <dd>  Returns the principal of the principal-key pair being guaranteed by
 the guarantor.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getPublicKey()"><b>getPublicKey</b></a>()
  <dd>  Returns the key of the principal-key pair being guaranteed by
 the guarantor.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString(boolean)"><b>toString</b></a>(boolean)
  <dd>  Returns a string that represents the contents of the certificate.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getGuarantor()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getGuarantor"><b>getGuarantor</b></a>
<pre>
 public abstract <a href="java.security.Principal.html#_top_">Principal</a> getGuarantor()
</pre>
<dl>
  <dd> 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.).
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the guarantor which guaranteed the principal-key
 binding.
  </dl></dd>
</dl>
<a name="getPrincipal()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getPrincipal"><b>getPrincipal</b></a>
<pre>
 public abstract <a href="java.security.Principal.html#_top_">Principal</a> getPrincipal()
</pre>
<dl>
  <dd> Returns the principal of the principal-key pair being guaranteed by
 the guarantor.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the principal to which this certificate is bound.
  </dl></dd>
</dl>
<a name="getPublicKey()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getPublicKey"><b>getPublicKey</b></a>
<pre>
 public abstract <a href="java.security.PublicKey.html#_top_">PublicKey</a> getPublicKey()
</pre>
<dl>
  <dd> Returns the key of the principal-key pair being guaranteed by
 the guarantor.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the public key that this certificate certifies belongs
 to a particular principal.
  </dl></dd>
</dl>
<a name="encode(java.io.OutputStream)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="encode"><b>encode</b></a>
<pre>
 public abstract void encode(<a href="java.io.OutputStream.html#_top_">OutputStream</a> stream) throws <a href="java.security.KeyException.html#_top_">KeyException</a>, <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Encodes the certificate to an output stream in a format that can
 be decoded by the <code>decode</code> method.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> stream - the output stream to which to encode the
 certificate.
    <dt> <b>Throws:</b> <a href="java.security.KeyException.html#_top_">KeyException</a>
    <dd> if the certificate is not
 properly initialized, or data is missing, etc.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if a stream exception occurs while
 trying to output the encoded certificate to the output stream.
    <dt> <b>See Also:</b>
    <dd> <a href="#decode">decode</a>, <a href="#getFormat">getFormat</a>
  </dl></dd>
</dl>
<a name="decode(java.io.InputStream)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="decode"><b>decode</b></a>
<pre>
 public abstract void decode(<a href="java.io.InputStream.html#_top_">InputStream</a> stream) throws <a href="java.security.KeyException.html#_top_">KeyException</a>, <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Decodes a certificate from an input stream. The format should be
 that returned by <code>getFormat</code> and produced by 
 <code>encode</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> stream - the input stream from which to fetch the data
 being decoded.
    <dt> <b>Throws:</b> <a href="java.security.KeyException.html#_top_">KeyException</a>
    <dd> if the certificate is not properly initialized,
 or data is missing, etc.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an exception occurs while trying to input
 the encoded certificate from the input stream.
    <dt> <b>See Also:</b>
    <dd> <a href="#encode">encode</a>, <a href="#getFormat">getFormat</a>
  </dl></dd>
</dl>
<a name="getFormat()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getFormat"><b>getFormat</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> getFormat()
</pre>
<dl>
  <dd> 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 <code>encode</code>
 and <code>decode</code> methods.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the name of the coding format.
  </dl></dd>
</dl>
<a name="toString(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> toString(boolean detailed)
</pre>
<dl>
  <dd> Returns a string that represents the contents of the certificate.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> detailed - whether or not to give detailed information
 about the certificate.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.html">This Package</a>  <a href="Package-java.security.html">Previous</a>  <a href="java.security.Key.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
