<!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.Key
</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="java.security.Certificate.html#_top_">Previous</a>  <a href="java.security.Principal.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface java.security.Key
</h1>
<dl>
  <dt> public interface <b>Key</b>
  <dt> extends <a href="java.io.Serializable.html#_top_">Serializable</a>
</dl>
The Key interface is the top-level interface for all keys. It
 defines the functionality shared by all key objects. All keys
 have three characteristics:
 <UL>
 <LI>An Algorithm
 <P>This is the key algorithm for that key. The key algorithm is usually
 an encryption or asymmetric operation algorithm (such as DSA or
 RSA), which will work with those algorithms and with related
 algorithms (such as MD5 with RSA, SHA-1 with RSA, Raw DSA, etc.)
 The name of the algorithm of a key is obtained using the 
 <a href = "#getAlgorithm">getAlgorithm</a> method.<P>
 <LI>An Encoded Form
 <P>This is an external encoded form for the key used when a standard
 representation of the key is needed outside the Java Virtual Machine,
 as when transmitting the key to some other party. The key
 is encoded according to a standard format (such as X.509
 or PKCS#8), and is returned using the 
 <a href = "#getEncoded">getEncoded</a> method.<P>
 <LI>A Format
 <P>This is the name of the format of the encoded key. It is returned 
 by the <a href = "#getFormat">getFormat</a> method.<P>
 </UL>
 Keys are generally obtained through key generators, certificates,
 or various Identity classes used to manage keys. There are no
 provisions in this release for the parsing of encoded keys and
 certificates.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.security.PublicKey.html#_top_">PublicKey</a>, <a href="java.security.PrivateKey.html#_top_">PrivateKey</a>, <a href="java.security.KeyPair.html#_top_">KeyPair</a>, <a href="java.security.KeyPairGenerator.html#_top_">KeyPairGenerator</a>, <a href="java.security.Identity.html#_top_">Identity</a>, <a href="java.security.IdentityScope.html#_top_">IdentityScope</a>, <a href="java.security.Signer.html#_top_">Signer</a>
</dl>
<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="#getAlgorithm()"><b>getAlgorithm</b></a>()
  <dd>  Returns the standard algorithm name this key is for.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getEncoded()"><b>getEncoded</b></a>()
  <dd>  Returns the encoded key.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getFormat()"><b>getFormat</b></a>()
  <dd>  Returns the format used to encode the key or null if the key does not
 support encoding.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getAlgorithm()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAlgorithm"><b>getAlgorithm</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> getAlgorithm()
</pre>
<dl>
  <dd> Returns the standard algorithm name this key is for. For
 example, "DSA" would indicate that this key is a DSA key. 
 Note that this method may return null, when the
 algorithm this key is for is unknown.
 <p>See Appendix A in the <a href=
 "../guide/security/CryptoSpec.html#AppA">
 Java Cryptography Architecture API Specification &amp; Reference </a> 
 for information about standard algorithm names.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the name of the algorithm this key is for, or null
 if the algorithm this key is for is unknown.
  </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 format used to encode the key or null if the key does not
 support encoding.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the format used to encode the key.
  </dl></dd>
</dl>
<a name="getEncoded()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getEncoded"><b>getEncoded</b></a>
<pre>
 public abstract byte[] getEncoded()
</pre>
<dl>
  <dd> Returns the encoded key.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the encoded key, or null if the key does not support
 encoding.
  </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="java.security.Certificate.html#_top_">Previous</a>  <a href="java.security.Principal.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
