<!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>
  Class java.security.Signature
</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.Security.html#_top_">Previous</a>  <a href="java.security.Signer.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.security.Signature
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.security.Signature
</pre>
<hr>
<dl>
  <dt> public abstract class <b>Signature</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
This Signature class is used to provide the functionality of a
 digital signature algorithm, such as <tt>RSA with MD5</tt> or
 <tt>DSA</tt>. Digital signatures are used for authentication and
 integrity assurance of digital data.
 </dl> 
 <p>Like other algorithm-based classes in Java Security, the
 Signature class has two major components:
 <dl>
 <dt><b>Digital Signature API</b> (Application Program Interface)
 <dd>This is the interface of methods called by applications needing
 digital signature services. The API consists of all public methods.
 <dt><b>Digital Signature SPI</b> (Service Provider Interface)
 <dd>This is the interface implemented by providers that supply
 specific algorithms. It consists of all methods whose names are
 prefixed by <code>engine</code>. Each such method is called by a
 correspondingly-named public API method. For example, the
 <code>engineSign</code> method is called by the
 <code>sign</code> method.  The SPI methods are abstract;
 providers must supply a concrete implementation.
 </dl>
 <p>Also like other algorithm-based classes in Java Security, Signature 
 provides implementation-independent algorithms, whereby a caller 
 (application code) requests a particular signature algorithm
 and is handed back a properly initialized Signature object. It is
 also possible, if desired, to request a particular algorithm from a
 particular provider. See the <code>getInstance </code> methods.
 <p>Thus, there are two ways to request a Signature algorithm object: by
 specifying either just an algorithm name, or both an algorithm name
 and a package provider. <ul>
 <li>If just an algorithm name is specified, the system will
 determine if there is an implementation of the algorithm requested
 available in the environment, and if there is more than one, if
 there is a preferred one.
 <li>If both an algorithm name and a package provider are specified,
 the system will determine if there is an implementation of the
 algorithm in the package requested, and throw an exception if there
 is not.
 </ul>
 <p>A Signature object can be used to generate and verify digital
 signatures.
 <p>There are three phases to the use of a Signature object for
 either signing data or verifying a signature:<ol>
 <li>Initialization, with either 
     <ul>
     <li>a public key, which initializes the signature for
     verification (see <a href = "#initVerify">initVerify</a>), or
     <li>a private key, which initializes the signature for
     signing (see <a href = "#initSign">initSign</a>).
     </ul><p>
 <li>Updating<p>
 <p>Depending on the type of initialization, this will update the
 bytes to be signed or verified. See the <a href =
 "#update(byte)">update</a> methods.<p>
 <li>Signing or Verifying 
 <p>a signature on all updated bytes. See <a
 href = "#sign">sign</a> and <a href = "#verify">verify</a>.
 </ol>
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#SIGN"><b>SIGN</b></a>
  <dd> 
 Possible <a href = "#state ">state </a> value, signifying that       
 this signature object has been initialized for signing.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#state"><b>state</b></a>
  <dd> 
 Current state of this signature object.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#UNINITIALIZED"><b>UNINITIALIZED</b></a>
  <dd> 
 Possible <a href = "#state ">state </a> value, signifying that       
 this signature object has not yet been initialized.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#VERIFY"><b>VERIFY</b></a>
  <dd> 
 Possible <a href = "#state ">state </a> value, signifying that       
 this signature object has been initialized for verification.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Signature(java.lang.String)"><b>Signature</b></a>(String)
  <dd>  Creates a Signature object for the specified algorithm.
</dl>
<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="#clone()"><b>clone</b></a>()
  <dd>  Returns a clone if the implementation is cloneable.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineGetParameter(java.lang.String)"><b>engineGetParameter</b></a>(String)
  <dd>  <b>SPI</b>: Gets the value of the specified algorithm parameter.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineInitSign(java.security.PrivateKey)"><b>engineInitSign</b></a>(PrivateKey)
  <dd>  <b>SPI</b>: Initializes this signature object with the specified
 private key for signing operations.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineInitVerify(java.security.PublicKey)"><b>engineInitVerify</b></a>(PublicKey)
  <dd>  <b>SPI</b>: Initializes this signature object with the specified
 public key for verification operations.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineSetParameter(java.lang.String, java.lang.Object)"><b>engineSetParameter</b></a>(String, Object)
  <dd>  <b>SPI</b>: Sets the specified algorithm parameter to the specified
 value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineSign()"><b>engineSign</b></a>()
  <dd> 
 <b>SPI</b>: Returns the signature bytes of all the data
 updated so far.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineUpdate(byte)"><b>engineUpdate</b></a>(byte)
  <dd>  <b>SPI</b>: Updates the data to be signed or verified
 using the specified byte.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineUpdate(byte[], int, int)"><b>engineUpdate</b></a>(byte[], int, int)
  <dd>  <b>SPI</b>: Updates the data to be signed or verified, using the 
 specified array of bytes, starting at the specified offset.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#engineVerify(byte[])"><b>engineVerify</b></a>(byte[])
  <dd> 
 <b>SPI</b>: Verifies the passed-in signature.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAlgorithm()"><b>getAlgorithm</b></a>()
  <dd> 
 Returns the name of the algorithm for this signature object.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getInstance(java.lang.String)"><b>getInstance</b></a>(String)
  <dd>  Generates a Signature object that implements the specified 
 algorithm.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getInstance(java.lang.String, java.lang.String)"><b>getInstance</b></a>(String, String)
  <dd> 
 Generates a Signature object implementing the specified
 algorithm, as supplied from the specified provider, if such an 
 algorithm is available from the provider.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getParameter(java.lang.String)"><b>getParameter</b></a>(String)
  <dd>  Gets the value of the specified algorithm parameter.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#initSign(java.security.PrivateKey)"><b>initSign</b></a>(PrivateKey)
  <dd>  Initialize this object for signing.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#initVerify(java.security.PublicKey)"><b>initVerify</b></a>(PublicKey)
  <dd>  Initializes this object for verification.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setParameter(java.lang.String, java.lang.Object)"><b>setParameter</b></a>(String, Object)
  <dd>  Sets the specified algorithm parameter to the specified value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#sign()"><b>sign</b></a>()
  <dd>  Returns the signature bytes of all the data updated.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a string representation of this signature object,       
 providing information that includes the state of the object       
 and the name of the algorithm used.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#update(byte)"><b>update</b></a>(byte)
  <dd>  Updates the data to be signed or verified by a byte.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#update(byte[])"><b>update</b></a>(byte[])
  <dd>  Updates the data to be signed or verified, using the specified
 array of bytes.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#update(byte[], int, int)"><b>update</b></a>(byte[], int, int)
  <dd>  Updates the data to be signed or verified, using the specified
 array of bytes, starting at the specified offset.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#verify(byte[])"><b>verify</b></a>(byte[])
  <dd>  Verifies the passed-in signature.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="UNINITIALIZED"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>UNINITIALIZED</b>
<pre>
 protected static final int UNINITIALIZED
</pre>
<dl>
  <dd> Possible <a href = "#state ">state </a> value, signifying that       
 this signature object has not yet been initialized.<p>
</dl>
<a name="SIGN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>SIGN</b>
<pre>
 protected static final int SIGN
</pre>
<dl>
  <dd> Possible <a href = "#state ">state </a> value, signifying that       
 this signature object has been initialized for signing.<p>
</dl>
<a name="VERIFY"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>VERIFY</b>
<pre>
 protected static final int VERIFY
</pre>
<dl>
  <dd> Possible <a href = "#state ">state </a> value, signifying that       
 this signature object has been initialized for verification.<p>
</dl>
<a name="state"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>state</b>
<pre>
 protected int state
</pre>
<dl>
  <dd> Current state of this signature object.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Signature"></a>
<a name="Signature(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Signature</b>
<pre>
 protected Signature(<a href="java.lang.String.html#_top_">String</a> algorithm)
</pre>
<dl>
  <dd> Creates a Signature object for the specified algorithm.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> algorithm - the standard string name of the algorithm.
 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.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getInstance(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInstance"><b>getInstance</b></a>
<pre>
 public static <a href="#_top_">Signature</a> getInstance(<a href="java.lang.String.html#_top_">String</a> algorithm) throws <a href="java.security.NoSuchAlgorithmException.html#_top_">NoSuchAlgorithmException</a>
</pre>
<dl>
  <dd> Generates a Signature object that implements the specified 
 algorithm. If the default provider package contains a Signature
 subclass implementing the algorithm, an instance of that subclass
 is returned. If the algorithm is not available in the default 
 package, other packages are searched.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> algorithm - the standard name of the algorithm requested.
 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.
    <dt> <b>Returns:</b>
    <dd> the new Signature object.
    <dt> <b>Throws:</b> <a href="java.security.NoSuchAlgorithmException.html#_top_">NoSuchAlgorithmException</a>
    <dd> if the algorithm is
 not available in the environment.
  </dl></dd>
</dl>
<a name="getInstance(java.lang.String, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInstance"><b>getInstance</b></a>
<pre>
 public static <a href="#_top_">Signature</a> getInstance(<a href="java.lang.String.html#_top_">String</a> algorithm,
                                     <a href="java.lang.String.html#_top_">String</a> provider) throws <a href="java.security.NoSuchAlgorithmException.html#_top_">NoSuchAlgorithmException</a>, <a href="java.security.NoSuchProviderException.html#_top_">NoSuchProviderException</a>
</pre>
<dl>
  <dd> Generates a Signature object implementing the specified
 algorithm, as supplied from the specified provider, if such an 
 algorithm is available from the provider.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> algorithm - the name of the algorithm requested.
 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.
    <dd> provider - the name of the provider.
    <dt> <b>Returns:</b>
    <dd> the new Signature object.
    <dt> <b>Throws:</b> <a href="java.security.NoSuchAlgorithmException.html#_top_">NoSuchAlgorithmException</a>
    <dd> if the algorithm is
 not available in the package supplied by the requested
 provider.
    <dt> <b>Throws:</b> <a href="java.security.NoSuchProviderException.html#_top_">NoSuchProviderException</a>
    <dd> if the provider is not
 available in the environment.
    <dt> <b>See Also:</b>
    <dd> <a href="java.security.Provider.html#_top_">Provider</a>
  </dl></dd>
</dl>
<a name="initVerify(java.security.PublicKey)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="initVerify"><b>initVerify</b></a>
<pre>
 public final void initVerify(<a href="java.security.PublicKey.html#_top_">PublicKey</a> publicKey) throws <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
</pre>
<dl>
  <dd> Initializes this object for verification. If this method is called
 again with a different argument, it negates the effect
 of this call.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> publicKey - the public key of the identity whose signature is
 going to be verified.
    <dt> <b>Throws:</b> <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
    <dd> if the key is invalid.
  </dl></dd>
</dl>
<a name="initSign(java.security.PrivateKey)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="initSign"><b>initSign</b></a>
<pre>
 public final void initSign(<a href="java.security.PrivateKey.html#_top_">PrivateKey</a> privateKey) throws <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
</pre>
<dl>
  <dd> Initialize this object for signing. If this method is called
 again with a different argument, it negates the effect
 of this call.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> privateKey - the private key of the identity whose signature
 is going to be generated.
    <dt> <b>Throws:</b> <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
    <dd> if the key is invalid.
  </dl></dd>
</dl>
<a name="sign()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="sign"><b>sign</b></a>
<pre>
 public final byte[] sign() throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> Returns the signature bytes of all the data updated.  The 
 signature returned is X.509-encoded. 
 <p>A call to this method resets this signature object to the state 
 it was in when previously initialized for signing via a
 call to <code>initSign(PrivateKey)</code>. That is, the object is 
 reset and available to generate another signature from the same 
 signer, if desired, via new calls to <code>update</code> and 
 <code>sign</code>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the signature bytes of the signing operation's result.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if this signature object is not
 initialized properly.
  </dl></dd>
</dl>
<a name="verify(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="verify"><b>verify</b></a>
<pre>
 public final boolean verify(byte signature[]) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> Verifies the passed-in signature. The signature bytes are expected 
 to be X.509-encoded. 
 <p>A call to this method resets this signature object to the state 
 it was in when previously initialized for verification via a
 call to <code>initVerify(PublicKey)</code>. That is, the object is 
 reset and available to verify another signature from the identity
 whose public key was specified in the call to <code>initVerify</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> signature - the signature bytes to be verified.
    <dt> <b>Returns:</b>
    <dd> true if the signature was verified, false if not.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if this signature object is not
 initialized properly, or the passed-in signature is improperly 
 encoded or of the wrong type, etc.
  </dl></dd>
</dl>
<a name="update(byte)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="update"><b>update</b></a>
<pre>
 public final void update(byte b) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> Updates the data to be signed or verified by a byte.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the byte to use for the update.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if this signature object is not
 initialized properly.
  </dl></dd>
</dl>
<a name="update(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="update"><b>update</b></a>
<pre>
 public final void update(byte data[]) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> Updates the data to be signed or verified, using the specified
 array of bytes.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> data - the byte array to use for the update.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if this signature object is not
 initialized properly.
  </dl></dd>
</dl>
<a name="update(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="update"><b>update</b></a>
<pre>
 public final void update(byte data[],
                          int off,
                          int len) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> Updates the data to be signed or verified, using the specified
 array of bytes, starting at the specified offset.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> data - the array of bytes.
    <dd> off - the offset to start from in the array of bytes.
    <dd> len - the number of bytes to use, starting at offset.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if this signature object is not
 initialized properly.
  </dl></dd>
</dl>
<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 final <a href="java.lang.String.html#_top_">String</a> getAlgorithm()
</pre>
<dl>
  <dd> Returns the name of the algorithm for this signature object.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the name of the algorithm for this signature object.
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a string representation of this signature object,       
 providing information that includes the state of the object       
 and the name of the algorithm used.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this signature object.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="setParameter(java.lang.String, java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setParameter"><b>setParameter</b></a>
<pre>
 public final void setParameter(<a href="java.lang.String.html#_top_">String</a> param,
                                <a href="java.lang.Object.html#_top_">Object</a> value) throws <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
</pre>
<dl>
  <dd> Sets the specified algorithm parameter to the specified value.
 This method supplies a general-purpose mechanism through
 which it is possible to set the various parameters of this object. 
 A parameter may be any settable parameter for the algorithm, such as 
 a parameter size, or a source of random bits for signature generation 
 (if appropriate), or an indication of whether or not to perform
 a specific but optional computation. A uniform algorithm-specific 
 naming scheme for each parameter is desirable but left unspecified 
 at this time.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> param - the string identifier of the parameter.
    <dd> value - the parameter value.
    <dt> <b>Throws:</b> <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
    <dd> if <code>param</code> is an
 invalid parameter for this signature algorithm engine,
 the parameter is already set
 and cannot be set again, a security exception occurs, and so on.
  </dl></dd>
</dl>
<a name="getParameter(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getParameter"><b>getParameter</b></a>
<pre>
 public final <a href="java.lang.Object.html#_top_">Object</a> getParameter(<a href="java.lang.String.html#_top_">String</a> param) throws <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
</pre>
<dl>
  <dd> Gets the value of the specified algorithm parameter. This method 
 supplies a general-purpose mechanism through which it is possible to 
 get the various parameters of this object. A parameter may be any 
 settable parameter for the algorithm, such as a parameter size, or 
 a source of random bits for signature generation (if appropriate), 
 or an indication of whether or not to perform a specific but optional 
 computation. A uniform algorithm-specific naming scheme for each 
 parameter is desirable but left unspecified at this time.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> param - the string name of the parameter.
    <dt> <b>Returns:</b>
    <dd> the object that represents the parameter value, or null if
 there is none.
    <dt> <b>Throws:</b> <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
    <dd> if <code>param</code> is an invalid
 parameter for this engine, or another exception occurs while
 trying to get this parameter.
  </dl></dd>
</dl>
<a name="engineInitVerify(java.security.PublicKey)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineInitVerify"><b>engineInitVerify</b></a>
<pre>
 protected abstract void engineInitVerify(<a href="java.security.PublicKey.html#_top_">PublicKey</a> publicKey) throws <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Initializes this signature object with the specified
 public key for verification operations.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> publicKey - the public key of the identity whose signature is
 going to be verified.
    <dt> <b>Throws:</b> <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
    <dd> if the key is improperly
 encoded, parameters are missing, and so on.
  </dl></dd>
</dl>
<a name="engineInitSign(java.security.PrivateKey)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineInitSign"><b>engineInitSign</b></a>
<pre>
 protected abstract void engineInitSign(<a href="java.security.PrivateKey.html#_top_">PrivateKey</a> privateKey) throws <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Initializes this signature object with the specified
 private key for signing operations.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> privateKey - the private key of the identity whose signature
 will be generated.
    <dt> <b>Throws:</b> <a href="java.security.InvalidKeyException.html#_top_">InvalidKeyException</a>
    <dd> if the key is improperly
 encoded, parameters are missing, and so on.
  </dl></dd>
</dl>
<a name="engineUpdate(byte)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineUpdate"><b>engineUpdate</b></a>
<pre>
 protected abstract void engineUpdate(byte b) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Updates the data to be signed or verified
 using the specified byte.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the byte to use for the update.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if the engine is not initialized
 properly.
  </dl></dd>
</dl>
<a name="engineUpdate(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineUpdate"><b>engineUpdate</b></a>
<pre>
 protected abstract void engineUpdate(byte b[],
                                      int off,
                                      int len) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Updates the data to be signed or verified, using the 
 specified array of bytes, starting at the specified offset.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> data - the array of bytes.
    <dd> off - the offset to start from in the array of bytes.
    <dd> len - the number of bytes to use, starting at offset.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if the engine is not initialized
 properly.
  </dl></dd>
</dl>
<a name="engineSign()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineSign"><b>engineSign</b></a>
<pre>
 protected abstract byte[] engineSign() throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Returns the signature bytes of all the data
 updated so far. The signature returned is X.509-encoded.    
 For more information about the X.509 encoding, see    
 <a href = "../guide/security/cert2.html">X.509 certificates</a>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the signature bytes of the signing operation's result.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if the engine is not
 initialized properly.
  </dl></dd>
</dl>
<a name="engineVerify(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineVerify"><b>engineVerify</b></a>
<pre>
 protected abstract boolean engineVerify(byte sigBytes[]) throws <a href="java.security.SignatureException.html#_top_">SignatureException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Verifies the passed-in signature. The signature bytes 
 are expected to be X.509-encoded. For more information about the 
 X.509 encoding, see <a href = "../guide/security/cert2.html">X.509 
 certificates</a>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> sigBytes - the signature bytes to be verified.
    <dt> <b>Returns:</b>
    <dd> true if the signature was verified, false if not.
    <dt> <b>Throws:</b> <a href="java.security.SignatureException.html#_top_">SignatureException</a>
    <dd> if the engine is not initialized
 properly, or the passed-in signature is improperly encoded or 
 of the wrong type, etc.
  </dl></dd>
</dl>
<a name="engineSetParameter(java.lang.String, java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineSetParameter"><b>engineSetParameter</b></a>
<pre>
 protected abstract void engineSetParameter(<a href="java.lang.String.html#_top_">String</a> param,
                                            <a href="java.lang.Object.html#_top_">Object</a> value) throws <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Sets the specified algorithm parameter to the specified
 value. This method supplies a general-purpose mechanism through
 which it is possible to set the various parameters of this object. 
 A parameter may be any settable parameter for the algorithm, such as 
 a parameter size, or a source of random bits for signature generation 
 (if appropriate), or an indication of whether or not to perform
 a specific but optional computation. A uniform algorithm-specific 
 naming scheme for each parameter is desirable but left unspecified 
 at this time.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> param - the string identifier of the parameter.
    <dd> value - the parameter value.
    <dt> <b>Throws:</b> <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
    <dd> if <code>param</code> is an
 invalid parameter for this signature algorithm engine,
 the parameter is already set
 and cannot be set again, a security exception occurs, and so on.
  </dl></dd>
</dl>
<a name="engineGetParameter(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="engineGetParameter"><b>engineGetParameter</b></a>
<pre>
 protected abstract <a href="java.lang.Object.html#_top_">Object</a> engineGetParameter(<a href="java.lang.String.html#_top_">String</a> param) throws <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
</pre>
<dl>
  <dd> <b>SPI</b>: Gets the value of the specified algorithm parameter. 
 This method supplies a general-purpose mechanism through which it 
 is possible to get the various parameters of this object. A parameter
 may be any settable parameter for the algorithm, such as a parameter 
 size, or  a source of random bits for signature generation (if 
 appropriate), or an indication of whether or not to perform a 
 specific but optional computation. A uniform algorithm-specific 
 naming scheme for each parameter is desirable but left unspecified 
 at this time.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> param - the string name of the parameter.
    <dt> <b>Returns:</b>
    <dd> the object that represents the parameter value, or null if
 there is none.
    <dt> <b>Throws:</b> <a href="java.security.InvalidParameterException.html#_top_">InvalidParameterException</a>
    <dd> if <code>param</code> is an
 invalid parameter for this engine, or another exception occurs while
 trying to get this parameter.
  </dl></dd>
</dl>
<a name="clone()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="clone"><b>clone</b></a>
<pre>
 public <a href="java.lang.Object.html#_top_">Object</a> clone() throws <a href="java.lang.CloneNotSupportedException.html#_top_">CloneNotSupportedException</a>
</pre>
<dl>
  <dd> Returns a clone if the implementation is cloneable.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a clone if the implementation is cloneable.
    <dt> <b>Throws:</b> <a href="java.lang.CloneNotSupportedException.html#_top_">CloneNotSupportedException</a>
    <dd> if this is called
 on an implementation that does not support <code>Cloneable</code>.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#clone()">clone</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </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.Security.html#_top_">Previous</a>  <a href="java.security.Signer.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
