|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/javadoc/cryptix-3.2.0/xjava/security/ |
Upload File : |
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN" "../../resources/xhtml11-target10.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><title>Cipher (cryptix JavaDoc)</title><script src="../../resources/gjdoc.js" type="text/javascript"><!-- this comment required for konqueror 3.2.2 --></script><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><meta name="generator" content="GNU Gjdoc Standard Doclet"/><meta name="keywords" content="xjava.security.Cipher class"/><meta name="keywords" content="UNINITIALIZED"/><meta name="keywords" content="ENCRYPT"/><meta name="keywords" content="DECRYPT"/><meta name="keywords" content="getPaddingScheme()"/><meta name="keywords" content="getInstance()"/><meta name="keywords" content="getState()"/><meta name="keywords" content="getAlgorithm()"/><meta name="keywords" content="getMode()"/><meta name="keywords" content="getPadding()"/><meta name="keywords" content="getProvider()"/><meta name="keywords" content="isPaddingBlockCipher()"/><meta name="keywords" content="outBufferSize()"/><meta name="keywords" content="outBufferSizeFinal()"/><meta name="keywords" content="inBufferSize()"/><meta name="keywords" content="inBufferSizeFinal()"/><meta name="keywords" content="blockSize()"/><meta name="keywords" content="getInputBlockSize()"/><meta name="keywords" content="getOutputBlockSize()"/><meta name="keywords" content="getPlaintextBlockSize()"/><meta name="keywords" content="getCiphertextBlockSize()"/><meta name="keywords" content="initEncrypt()"/><meta name="keywords" content="initDecrypt()"/><meta name="keywords" content="update()"/><meta name="keywords" content="crypt()"/><meta name="keywords" content="doFinal()"/><meta name="keywords" content="setParameter()"/><meta name="keywords" content="getParameter()"/><meta name="keywords" content="clone()"/><meta name="keywords" content="toString()"/><meta name="keywords" content="engineSetPaddingScheme()"/><meta name="keywords" content="engineBlockSize()"/><meta name="keywords" content="enginePlaintextBlockSize()"/><meta name="keywords" content="engineCiphertextBlockSize()"/><meta name="keywords" content="engineOutBufferSize()"/><meta name="keywords" content="engineInBufferSize()"/><meta name="keywords" content="engineInitEncrypt()"/><meta name="keywords" content="engineInitDecrypt()"/><meta name="keywords" content="engineUpdate()"/><meta name="keywords" content="engineCrypt()"/><meta name="keywords" content="engineSetParameter()"/><meta name="keywords" content="engineGetParameter()"/><meta name="keywords" content="getAlgorithms()"/><link rel="stylesheet" type="text/css" href="../../resources/gjdochtml-clean-layout.css" title="GNU Clean"/><link rel="stylesheet" type="text/css" href="../../resources/gjdochtml-clean-color1.css" title="GNU Clean"/></head><body class="content class" onload="if(parent.contentPageLoaded)parent.contentPageLoaded(document.title)"><table class="navbar div top"><tr><td class="navbar div top"><div class="navbar div top"><span class="navbar item enabled"><a href="../../overview-summary.html">Overview</a></span> <span class="navbar item enabled"><a href="package-summary.html">Package</a></span> <span class="navbar item enabled"><a href="tree.html">Tree</a></span> <span class="navbar item enabled"><a href="../../alphaindex.html">Index</a></span> <span class="navbar item enabled"><a href="../../deprecated.html">Deprecated</a></span> <span class="navbar item enabled"><a href="../../about.html">About</a></span></div></td></tr><tr><td class="navi"><a href="../../xjava/security/AsymmetricCipher.html">Prev Class</a> | <a href="../../xjava/security/CipherInputStream.html">Next Class</a></td><td class="navi"><a href="../../index.html" title="Show in a frameset" target="_top">Frames</a> | <a href="Cipher.html" title="Show without frames" target="_top">No Frames</a> </td></tr><tr><td class="navi">Summary: Nested | <a href="#summary-fields">Field</a> | <a href="#summary-methods">Method</a> | <a href="#summary-constructors">Constr</a></td><td class="navi">Detail: Nested | <a href="#detail-fields">Field</a> | <a href="#detail-methods">Method</a> | <a href="#detail-constructors">Constr</a></td></tr></table><div class="class title outer"><h3 class="class title-package">xjava.security</h3><h1 class="class title-class">Class Cipher</h1></div><div class="class inheritance-tree"><ul class="inheritance 0"><li class="inheritance 0"><code>java.lang.Object</code></li><li><ul class="inheritance 1"><li class="inheritance 1"><code><a href="../../xjava/security/IJCE_Traceable.html">xjava.security.IJCE_Traceable</a></code></li><li><ul class="inheritance 2"><li class="inheritance 2"><code>xjava.security.Cipher</code></li><li></li></ul></li></ul></li></ul></div><dl class="class knownimplementing"><dt class="header"><b>Implemented Interfaces:</b></dt><dd class="item"><a href="../../xjava/security/Parameterized.html" title="Interface in xjava.security">Parameterized</a></dd></dl><dl class="class subclasses"><dt class="class subclasses header"><b>Known Direct Subclasses:</b></dt><dd class="class subclasses header"><a href="../../cryptix/provider/cipher/Blowfish.html" title="Class in cryptix.provider.cipher">Blowfish</a>, <a href="../../cryptix/provider/cipher/CAST5.html" title="Class in cryptix.provider.cipher">CAST5</a>, <a href="../../cryptix/provider/cipher/DES.html" title="Class in cryptix.provider.cipher">DES</a>, <a href="../../cryptix/provider/cipher/DES2X.html" title="Class in cryptix.provider.cipher">DES2X</a>, <a href="../../cryptix/provider/cipher/DESX.html" title="Class in cryptix.provider.cipher">DESX</a>, <a href="../../cryptix/provider/cipher/DES_EDE3.html" title="Class in cryptix.provider.cipher">DES_EDE3</a>, <a href="../../cryptix/provider/cipher/IDEA.html" title="Class in cryptix.provider.cipher">IDEA</a>, <a href="../../cryptix/provider/cipher/LOKI91.html" title="Class in cryptix.provider.cipher">LOKI91</a>, <a href="../../xjava/security/Mode.html" title="Class in xjava.security">Mode</a>, <a href="../../cryptix/provider/elgamal/RawElGamalCipher.html" title="Class in cryptix.provider.elgamal">RawElGamalCipher</a>, <a href="../../cryptix/provider/rsa/RawRSACipher.html" title="Class in cryptix.provider.rsa">RawRSACipher</a>, <a href="../../cryptix/provider/cipher/RC2.html" title="Class in cryptix.provider.cipher">RC2</a>, <a href="../../cryptix/provider/cipher/RC4.html" title="Class in cryptix.provider.cipher">RC4</a>, <a href="../../cryptix/provider/cipher/Rijndael.html" title="Class in cryptix.provider.cipher">Rijndael</a>, <a href="../../cryptix/provider/cipher/SAFER.html" title="Class in cryptix.provider.cipher">SAFER</a>, <a href="../../cryptix/provider/cipher/SPEED.html" title="Class in cryptix.provider.cipher">SPEED</a>, <a href="../../cryptix/provider/cipher/Square.html" title="Class in cryptix.provider.cipher">Square</a></dd></b></dt></dl><hr/><div class="class synopsis outer"><div class="class synopsis declaration"><code>public abstract class <b class="class synopsis name">Cipher</b></code></div><div class="class synopsis superclass"><code>extends <a href="../../xjava/security/IJCE_Traceable.html" title="Class in xjava.security">IJCE_Traceable</a></code></div><div class="class synopsis implements"><code>implements <a href="../../xjava/security/Parameterized.html" title="Interface in xjava.security">Parameterized</a></code></div></div><hr/><div class="class description"> This class is used to provide the functionality of a general purpose
encryption algorithm, such as DES or RSA. Encryption is used to ensure
confidentiality of digital data.
<p/>
This class follows the general algorithm architecture found elsewhere
in the security API: the base class provides an algorithm-independent
interface to basic encryption functionality, with provider implementation
subclassing a subset of the behaviours.
<p/>
Like other algorithm-based classes in Java Security, the Cipher
class is separated between application and provider interfaces:
<dl>
<dt><b>Cipher API</b></dt><dd></dd><dt><b>Cipher SPI</b></dt><dd><code>engine</code><code>engineInitEncrypt</code><code>initEncrypt</code></dd></dl>
<p/>
Ciphers represented by this class satisfy the following constraints:
<ul><li> At any point in time the cipher has a plaintext block size, and
a ciphertext block size, both expressed in bytes. These sizes may
change when initEncrypt or initDecrypt are called, and they may
be invalid before the cipher is initialized, but they do not
change at other times.
</li><li> A plaintext block encrypts to exactly one ciphertext block, and
a ciphertext block decrypts to exactly one plaintext block.
</li></ul>
<p/>
Byte-oriented stream ciphers (or ciphers in CFB and OFB modes, for
example) have plaintext and ciphertext block sizes of 1 byte. For
public key ciphers, it is common for the block sizes to be dependent
on the length of some parameter of the public key.
<p/>
A block cipher implementation may either implement its own buffering
(by passing <code>implBuffering == true</code> to the constructor), or leave
it to the Cipher superclass (<code>implBuffering</code> == false). When
the implementation handles buffering, data passed to <code>update</code> is
passed directly on to <code>engineUpdate</code>, and data passed to
<code>crypt</code> is passed to <code>engineUpdate</code>, followed
immediately by a call to <code>engineCrypt</code>.
<p/>
When the Cipher superclass handles buffering, up to one block is buffered,
in order to ensure that the length of data passed to <code>engineUpdate</code>
is always a multiple of the block size. In this case the <code>engineCrypt</code>
method is not used.
<p/>
Cipher implementations are not required or expected to be threadsafe.
If methods of a single Cipher object are called simultaneously by more
than one thread, the result will be unpredictable.
<p/>
<b>Copyright</b> © 1997
<a href="http://www.systemics.com/">Systemics Ltd</a> on behalf of the
<a href="http://www.systemics.com/docs/cryptix/">Cryptix Development Team</a>.
<br/>All rights reserved.
<p/>
<b>$Revision: 1.9 $</b>
</div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>Authors:</b></dt><dd class="tag item">David Hopwood</dd><dd class="tag item">Raif S. Naffah</dd></dl></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>Since:</b></dt><dd>IJCE 1.0.0</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><a name="summary-fields" id="summary-fields"/><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table header"><td colspan="2"><h2 class="table header">Field Summary</h2></td></tr><tr><td class="left" valign="top"><code class="synopsis">static int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#DECRYPT">DECRYPT</a></code></dt><dd class="description"> The state of the cipher when it is ready to decrypt, that is,
the state it is in right after a call to <code>initDecrypt</code>.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#ENCRYPT">ENCRYPT</a></code></dt><dd class="description"> The state of the cipher when it is ready to encrypt, that is,
the state it is in right after a call to <code>initEncrypt</code>.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#UNINITIALIZED">UNINITIALIZED</a></code></dt><dd class="description"> The state of the cipher object when it is uninitialized,
that is, the state it is in right after it has been created.</dd></dl></td></tr></table></dd></dl><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table sub header"><td colspan="2"><h3 class="table sub header">Fields inherited from class xjava.security.<a href="../../xjava/security/IJCE_Traceable.html" title="Class in xjava.security">IJCE_Traceable</a></h3></td></tr><tr><td class="inherited"><a href="../../xjava/security/IJCE_Traceable.html#tracing"><code class="member">tracing</code></a></td></tr></table></dd></dl><a name="summary-constructors" id="summary-constructors"/><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table header"><td colspan="2"><h2 class="table header">Constructor Summary</h2></td></tr><tr><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#Cipher()">Cipher</a>()</code></dt><dd class="description"><span class="deprecated"><b class="deprecated header">Deprecated. </b><i class="deprecated"></i><span class="deprecated"></dd></dl></td></tr><tr><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#Cipher(boolean,String,String)">Cipher</a>(boolean implBuffering, String provider, String algorithm)</code></dt><dd class="description"> This constructor is identical to the previous one (with arguments
boolean, boolean, String), except that it does not have the redundant
<i>implPadding</i> parameter, and also allows the algorithm name
to be specified.</dd></dl></td></tr><tr><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#Cipher(boolean,boolean,String)">Cipher</a>(boolean implBuffering, boolean implPadding, String provider)</code></dt><dd class="description"> Constructor for a Cipher.</dd></dl></td></tr></table></dd></dl><a name="summary-methods" id="summary-methods"/><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table header"><td colspan="2"><h2 class="table header">Method Summary</h2></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#blockSize()">blockSize</a>()</code></dt><dd class="description"> Returns the length of a block for this cipher.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> Object</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#clone()">clone</a>()</code></dt><dd class="description"> Returns a clone of this cipher.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> byte[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#crypt(byte[])">crypt</a>(byte[] in)</code></dt><dd class="description"> Encrypts or decrypts the specified array of data, which will be
automatically padded/unpadded as necessary.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> byte[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#crypt(byte[],int,int)">crypt</a>(byte[] in, int offset, int length)</code></dt><dd class="description"> Encrypts or decrypts the specified array of data, which will be
automatically padded/unpadded as necessary.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#crypt(byte[],int,int,byte[],int)">crypt</a>(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)</code></dt><dd class="description"> Encrypts or decrypts the specified subarray of data, pads or unpads
it as necessary, and places the result in the specified output buffer.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> byte[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#doFinal(byte[])">doFinal</a>(byte[] in)</code></dt><dd class="description"> Equivalent to <code>crypt(in)</code>.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> byte[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#doFinal(byte[],int,int)">doFinal</a>(byte[] in, int offset, int length)</code></dt><dd class="description"> Equivalent to <code>crypt(in, offset, length)</code>.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#doFinal(byte[],int,int,byte[])">doFinal</a>(byte[] in, int inOffset, int inLen, byte[] out)</code></dt><dd class="description"> Equivalent to <code>crypt(in, inOffset, inLen, out, 0)</code>.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#doFinal(byte[],int,int,byte[],int)">doFinal</a>(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)</code></dt><dd class="description"> Equivalent to <code>crypt(in, inOffset, inLen, out, outOffset)</code>.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineBlockSize()">engineBlockSize</a>()</code></dt><dd class="description"> <b>SPI</b>: Returns the length of a block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineCiphertextBlockSize()">engineCiphertextBlockSize</a>()</code></dt><dd class="description"> <b>SPI</b>: Returns the length of a ciphertext block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineCrypt(byte[],int)">engineCrypt</a>(byte[] out, int outOffset)</code></dt><dd class="description"> <b>SPI</b>: Process data buffered by this cipher implementation.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected Object</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineGetParameter(String)">engineGetParameter</a>(String param)</code></dt><dd class="description"> <b>SPI</b>: Gets the value of the specified algorithm parameter.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineInBufferSize(int,boolean)">engineInBufferSize</a>(int outLen, boolean isFinal)</code></dt><dd class="description"> <b>SPI</b>: Returns the minimum number of bytes of input, that
will cause an output of <i>outLen</i> bytes from a call to
<code>engineUpdate</code> (when <i>isFinal</i> is false), or
successive calls to both <code>engineUpdate</code> and
<code>engineCrypt</code> (when <i>isFinal</i> is true).</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected abstract void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineInitDecrypt(Key)">engineInitDecrypt</a>(Key key)</code></dt><dd class="description"> <b>SPI</b>: Initializes this cipher for decryption, using the
specified key.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected abstract void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineInitEncrypt(Key)">engineInitEncrypt</a>(Key key)</code></dt><dd class="description"> <b>SPI</b>: Initializes this cipher for encryption, using the
specified key.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineOutBufferSize(int,boolean)">engineOutBufferSize</a>(int inLen, boolean isFinal)</code></dt><dd class="description"> <b>SPI</b>: Returns the length of output buffer required for a given
length of input, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#enginePlaintextBlockSize()">enginePlaintextBlockSize</a>()</code></dt><dd class="description"> <b>SPI</b>: Returns the length of a plaintext block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineSetPaddingScheme(xjava.security.PaddingScheme)">engineSetPaddingScheme</a>(<a href="../../xjava/security/PaddingScheme.html" title="Class in xjava.security">PaddingScheme</a> padding)</code></dt><dd class="description"> <b>SPI</b>: Sets the object that will implement padding for this cipher.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineSetParameter(String,Object)">engineSetParameter</a>(String param, Object value)</code></dt><dd class="description"> <b>SPI</b>: Sets the specified algorithm parameter to the specified
value.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected abstract int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#engineUpdate(byte[],int,int,byte[],int)">engineUpdate</a>(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)</code></dt><dd class="description"> <b>SPI</b>: This is the main engine method for updating data.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> String</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getAlgorithm()">getAlgorithm</a>()</code></dt><dd class="description"> Returns this algorithm's standard cipher name (<em>not</em> including
mode and padding).</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static String[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getAlgorithms()">getAlgorithms</a>()</code></dt><dd class="description"> Gets the standard names of all Ciphers implemented by any
installed provider.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static String[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getAlgorithms(Provider)">getAlgorithms</a>(Provider provider)</code></dt><dd class="description"> Gets the standard names of all Ciphers implemented by a provider.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getCiphertextBlockSize()">getCiphertextBlockSize</a>()</code></dt><dd class="description"> Returns the length of a ciphertext block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getInputBlockSize()">getInputBlockSize</a>()</code></dt><dd class="description"> Returns the length of an input block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a></code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getInstance(String)">getInstance</a>(String algorithm)</code></dt><dd class="description"> Generates a Cipher object that implements the given algorithm.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a></code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getInstance(String,String)">getInstance</a>(String algorithm, String provider)</code></dt><dd class="description"> Generates a Cipher object that implements the given cipher, from
the given provider.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">static <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a></code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getInstance(xjava.security.Cipher,xjava.security.Mode,xjava.security.PaddingScheme)">getInstance</a>(<a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a> cipher, <a href="../../xjava/security/Mode.html" title="Class in xjava.security">Mode</a> mode, <a href="../../xjava/security/PaddingScheme.html" title="Class in xjava.security">PaddingScheme</a> padding)</code></dt><dd class="description"> Generates a new Cipher object by composing the given Cipher, Mode and
PaddingScheme objects.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> String</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getMode()">getMode</a>()</code></dt><dd class="description"> Returns this algorithm's standard mode name.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getOutputBlockSize()">getOutputBlockSize</a>()</code></dt><dd class="description"> Returns the length of an output block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> String</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getPadding()">getPadding</a>()</code></dt><dd class="description"> Returns this algorithm's standard padding scheme name.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis">protected <a href="../../xjava/security/PaddingScheme.html" title="Class in xjava.security">PaddingScheme</a></code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getPaddingScheme()">getPaddingScheme</a>()</code></dt><dd class="description"> Returns the object implementing padding for this cipher, or null if
there is no such object.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> Object</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getParameter(String)">getParameter</a>(String param)</code></dt><dd class="description"> Gets the value of the specified algorithm parameter.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getPlaintextBlockSize()">getPlaintextBlockSize</a>()</code></dt><dd class="description"> Returns the length of a plaintext block, in bytes.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> String</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getProvider()">getProvider</a>()</code></dt><dd class="description"> Returns the name of the provider of this cipher.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#getState()">getState</a>()</code></dt><dd class="description"> Returns the state of this Cipher object.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#inBufferSize(int)">inBufferSize</a>(int outLen)</code></dt><dd class="description"> Returns the minimum number of bytes of input, that will cause an
output of <i>outLen</i> bytes from a call to <code>update</code> (i.e.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#inBufferSizeFinal(int)">inBufferSizeFinal</a>(int outLen)</code></dt><dd class="description"> Returns the minimum number of bytes of input, that will cause an
output of <i>outLen</i> bytes from a call to <code>crypt</code>
(including padding for the final block of the stream, if applicable).</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#initDecrypt(Key)">initDecrypt</a>(Key key)</code></dt><dd class="description"> Initializes this cipher for decryption, using the specified
key.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#initEncrypt(Key)">initEncrypt</a>(Key key)</code></dt><dd class="description"> Initializes this cipher for encryption, using the specified
key.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> boolean</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#isPaddingBlockCipher()">isPaddingBlockCipher</a>()</code></dt><dd class="description"> Returns true if this cipher is a padding block cipher.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#outBufferSize(int)">outBufferSize</a>(int inLen)</code></dt><dd class="description"> Returns the size of the buffer necessary to hold the output
resulting from a call to <code>update</code> (i.e.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#outBufferSizeFinal(int)">outBufferSizeFinal</a>(int inLen)</code></dt><dd class="description"> Returns the size of the buffer necessary to hold the output
resulting from a call to <code>crypt</code> (including padding
for the final block of the stream, if applicable).</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#setParameter(String,Object)">setParameter</a>(String param, Object value)</code></dt><dd class="description"> Sets the specified algorithm parameter to the specified value.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> String</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#toString()">toString</a>()</code></dt></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> byte[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#update(byte[])">update</a>(byte[] in)</code></dt><dd class="description"> Encrypts or decrypts the specified array of data, which is not the
final data in this stream.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> byte[]</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#update(byte[],int,int)">update</a>(byte[] in, int offset, int length)</code></dt><dd class="description"> Encrypts or decrypts the specified subarray of data, which is not the
final data in this stream.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#update(byte[],int,int,byte[])">update</a>(byte[] in, int inOffset, int inLen, byte[] out)</code></dt><dd class="description"> Encrypts or decrypts the specified subarray of data, which is not the
final data in this stream, and places the result in the specified
output buffer (starting at offset 0).</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#update(byte[],int,int,byte[],int)">update</a>(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)</code></dt><dd class="description"> Encrypts or decrypts the specified subarray of data, which is not the
final data in this stream, and places the result in the specified
output buffer.</dd></dl></td></tr></table></dd></dl><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table sub header"><td colspan="2"><h3 class="table sub header">Methods inherited from class xjava.security.<a href="../../xjava/security/IJCE_Traceable.html" title="Class in xjava.security">IJCE_Traceable</a></h3></td></tr><tr><td class="inherited"><a href="../../xjava/security/IJCE_Traceable.html#disableTracing()" title="disableTracing()"><code class="member">disableTracing</code></a>, <a href="../../xjava/security/IJCE_Traceable.html#enableTracing(PrintWriter)" title="enableTracing(PrintWriter)"><code class="member">enableTracing</code></a>, <a href="../../xjava/security/IJCE_Traceable.html#traceMethod(String)" title="traceMethod(String)"><code class="member">traceMethod</code></a>, <a href="../../xjava/security/IJCE_Traceable.html#traceResult(String)" title="traceResult(String)"><code class="member">traceResult</code></a>, <a href="../../xjava/security/IJCE_Traceable.html#traceResult(int)" title="traceResult(int)"><code class="member">traceResult</code></a>, <a href="../../xjava/security/IJCE_Traceable.html#traceVoidMethod(String)" title="traceVoidMethod(String)"><code class="member">traceVoidMethod</code></a></td></tr></table></dd></dl><a name="detail-fields" id="detail-fields"/><h2 class="section header">Field Details</h2><div class="section"><a name="DECRYPT" id="DECRYPT"/><div class="member detail outer"><h3 class="member detail name">DECRYPT</h3><pre class="member detail synopsis">public static final int DECRYPT</pre><blockquote class="member detail name"><div class="member detail description"> The state of the cipher when it is ready to decrypt, that is,
the state it is in right after a call to <code>initDecrypt</code>.
</div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Field Value:</b></dt><dd class="member detail thrown item">2</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><a href="../../xjava/security/Cipher.html#initDecrypt(Key)"><code>initDecrypt(Key)</code></a></dd></dl></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="ENCRYPT" id="ENCRYPT"/><div class="member detail outer"><h3 class="member detail name">ENCRYPT</h3><pre class="member detail synopsis">public static final int ENCRYPT</pre><blockquote class="member detail name"><div class="member detail description"> The state of the cipher when it is ready to encrypt, that is,
the state it is in right after a call to <code>initEncrypt</code>.
</div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Field Value:</b></dt><dd class="member detail thrown item">1</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><a href="../../xjava/security/Cipher.html#initEncrypt(Key)"><code>initEncrypt(Key)</code></a></dd></dl></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="UNINITIALIZED" id="UNINITIALIZED"/><div class="member detail outer"><h3 class="member detail name">UNINITIALIZED</h3><pre class="member detail synopsis">public static final int UNINITIALIZED</pre><blockquote class="member detail name"><div class="member detail description"> The state of the cipher object when it is uninitialized,
that is, the state it is in right after it has been created.
</div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Field Value:</b></dt><dd class="member detail thrown item">0</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div></div><a name="detail-constructors" id="detail-constructors"/><h2 class="section header">Constructor Details</h2><div class="section"><a name="Cipher()" id="Cipher()"/><div class="member detail outer"><h3 class="member detail name">Cipher</h3><pre class="member detail synopsis">protected Cipher()</pre><blockquote class="member detail name"><p class="deprecated"><b class="deprecated header">Deprecated. </b><i class="deprecated"></i><p class="deprecated"><div class="member detail description"> The JCE docs say: "Constructor used for dynamic instantiation."
I don't understand why this is needed. --DJH
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="Cipher(boolean,String,String)" id="Cipher(boolean,String,String)"/><div class="member detail outer"><h3 class="member detail name">Cipher</h3><pre class="member detail synopsis">protected Cipher(boolean implBuffering,
String provider,
String algorithm)</pre><blockquote class="member detail name"><div class="member detail description"> This constructor is identical to the previous one (with arguments
boolean, boolean, String), except that it does not have the redundant
<i>implPadding</i> parameter, and also allows the algorithm name
to be specified.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This constructor
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">implBuffering</code><span class="separator"> - </span><span class="description">if true, this argument indicates that data
will always be passed from update/crypt to
engineUpdate/engineCrypt without modification.</span></dd><dd class="item"><code class="name">provider</code><span class="separator"> - </span><span class="description">the name of the provider of the underlying
cryptographic engine.</span></dd><dd class="item"><code class="name">algorithm</code><span class="separator"> - </span><span class="description">the name of this algorithm (optionally with
mode and padding, separated by '/'), as it is
configured in the properties file.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="Cipher(boolean,boolean,String)" id="Cipher(boolean,boolean,String)"/><div class="member detail outer"><h3 class="member detail name">Cipher</h3><pre class="member detail synopsis">protected Cipher(boolean implBuffering,
boolean implPadding,
String provider)</pre><blockquote class="member detail name"><div class="member detail description"> Constructor for a Cipher. This constructor is only for use
by subclasses, which should pass the correct arguments to convey
their behaviour to the superclass. Applications cannot call this
constructor directly.
<p/>
For byte-oriented stream ciphers (where the input block size is 1),
buffering is not needed, and the <i>implBuffering</i> parameter has
no effect.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">In this version
of IJCE, <i>implPadding</i> must be false. If it is true, an
<samp>IllegalArgumentException</samp> is thrown.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">implBuffering</code><span class="separator"> - </span><span class="description">if true, this argument indicates that data
will always be passed from update/crypt to
engineUpdate/engineCrypt without modification.</span></dd><dd class="item"><code class="name">implPadding</code><span class="separator"> - </span><span class="description">must be false.</span></dd><dd class="item"><code class="name">provider</code><span class="separator"> - </span><span class="description">the name of the provider of the underlying
cryptographic engine.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div></div><a name="detail-methods" id="detail-methods"/><h2 class="section header">Method Details</h2><div class="section"><a name="blockSize()" id="blockSize()"/><div class="member detail outer"><h3 class="member detail name">blockSize</h3><pre class="member detail synopsis">public final int blockSize()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the length of a block for this cipher. If plaintext and
ciphertext blocks are different lengths, this method throws an
IllegalBlockSizeException.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of a block.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="clone()" id="clone()"/><div class="member detail outer"><h3 class="member detail name">clone</h3><pre class="member detail synopsis">public Object clone()
throws CloneNotSupportedException</pre><blockquote class="member detail name"><div class="member detail description"> Returns a clone of this cipher.
<p/>
Note: In JavaSoft's version of JCE, <code>Cipher.clone()</code> is
protected. This is not very useful, since then an application (as opposed
to the cipher implementation itself) is not able to call it.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="crypt(byte[])" id="crypt(byte[])"/><div class="member detail outer"><h3 class="member detail name">crypt</h3><pre class="member detail synopsis">public final byte[] crypt(byte[] in)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified array of data, which will be
automatically padded/unpadded as necessary.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state. This method will automatically allocate
an output buffer of the right size.
<p/>
If the final block is incomplete, the cipher must have a padding scheme
other than "NONE", and it must be in the ENCRYPT state. If this is not
the case, an IllegalBlockSizeException will be thrown.
<p/>
If the cipher is in the DECRYPT state and padding is being used,
at least one full ciphertext block should be passed to <code>crypt</code>.
This is necessary because the last block contains information needed to
determine the length of the original plaintext.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the encryption or decryption result.</dd></dl></div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Throws:</b></dt><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></code><span class="separator"> - </span><span class="description">if the final block cannot be
padded or unpadded.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="crypt(byte[],int,int)" id="crypt(byte[],int,int)"/><div class="member detail outer"><h3 class="member detail name">crypt</h3><pre class="member detail synopsis">public final byte[] crypt(byte[] in,
int offset,
int length)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified array of data, which will be
automatically padded/unpadded as necessary.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state. This method will automatically allocate
an output buffer of the right size.
<p/>
If the final block is incomplete, the cipher must have a padding scheme
other than "NONE", and it must be in the ENCRYPT state. If this is not
the case, an IllegalBlockSizeException will be thrown.
<p/>
If the cipher is in the DECRYPT state and padding is being used,
at least one full ciphertext block should be passed to <code>crypt</code>.
This is necessary because the last block contains information needed to
determine the length of the original plaintext.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd><dd class="item"><code class="name">offset</code><span class="separator"> - </span><span class="description">the offset indicating where the subarray starts in the
<i>in</i> array.</span></dd><dd class="item"><code class="name">length</code><span class="separator"> - </span><span class="description">the length of the subarray.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the encryption or decryption result.</dd></dl></div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Throws:</b></dt><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></code><span class="separator"> - </span><span class="description">if the final block cannot be padded
or unpadded.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="crypt(byte[],int,int,byte[],int)" id="crypt(byte[],int,int,byte[],int)"/><div class="member detail outer"><h3 class="member detail name">crypt</h3><pre class="member detail synopsis">public final int crypt(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified subarray of data, pads or unpads
it as necessary, and places the result in the specified output buffer.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state.
<p/>
If the final block is incomplete, the cipher must have a padding scheme
other than "NONE", and it must be in the ENCRYPT state. If this is not
the case, an IllegalBlockSizeException will be thrown.
<p/>
If the cipher is in the DECRYPT state and padding is being used,
at least one full ciphertext block should be passed to <code>crypt</code>.
This is necessary because the last block contains information needed to
determine the length of the original plaintext.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd><dd class="item"><code class="name">inOffset</code><span class="separator"> - </span><span class="description">the offset indicating where the subarray starts in
the <i>in</i> array.</span></dd><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the length of the subarray.</span></dd><dd class="item"><code class="name">out</code><span class="separator"> - </span><span class="description">the output buffer.</span></dd><dd class="item"><code class="name">outOffset</code><span class="separator"> - </span><span class="description">the offset indicating where to start writing the
result into the output buffer.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the number of bytes written.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="doFinal(byte[])" id="doFinal(byte[])"/><div class="member detail outer"><h3 class="member detail name">doFinal</h3><pre class="member detail synopsis">public final byte[] doFinal(byte[] in)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Equivalent to <code>crypt(in)</code>.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="doFinal(byte[],int,int)" id="doFinal(byte[],int,int)"/><div class="member detail outer"><h3 class="member detail name">doFinal</h3><pre class="member detail synopsis">public final byte[] doFinal(byte[] in,
int offset,
int length)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Equivalent to <code>crypt(in, offset, length)</code>.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="doFinal(byte[],int,int,byte[])" id="doFinal(byte[],int,int,byte[])"/><div class="member detail outer"><h3 class="member detail name">doFinal</h3><pre class="member detail synopsis">public final int doFinal(byte[] in,
int inOffset,
int inLen,
byte[] out)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Equivalent to <code>crypt(in, inOffset, inLen, out, 0)</code>.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="doFinal(byte[],int,int,byte[],int)" id="doFinal(byte[],int,int,byte[],int)"/><div class="member detail outer"><h3 class="member detail name">doFinal</h3><pre class="member detail synopsis">public final int doFinal(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)
throws <a href="../../xjava/security/IllegalBlockSizeException.html" title="Class in xjava.security">IllegalBlockSizeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Equivalent to <code>crypt(in, inOffset, inLen, out, outOffset)</code>.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineBlockSize()" id="engineBlockSize()"/><div class="member detail outer"><h3 class="member detail name">engineBlockSize</h3><pre class="member detail synopsis">protected int engineBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Returns the length of a block, in bytes. Ciphers for
which plaintext and ciphertext blocks are the same size may override
this method. Otherwise, both enginePlaintextBlockSize and
engineCiphertextBlockSize should be overridden.
<p/>
The value may change when <code>initEncrypt</code> or
<code>initDecrypt</code> is called, but it should not change at
other times.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of a block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineCiphertextBlockSize()" id="engineCiphertextBlockSize()"/><div class="member detail outer"><h3 class="member detail name">engineCiphertextBlockSize</h3><pre class="member detail synopsis">protected int engineCiphertextBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Returns the length of a ciphertext block, in bytes.
For byte-oriented stream ciphers, this method should return 1.
<p/>
The value may change when <code>initEncrypt</code> or
<code>initDecrypt</code> is called, but it should not change at
other times.
<p/>
The default implementation returns <code>engineBlockSize()</code>.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of a ciphertext block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineCrypt(byte[],int)" id="engineCrypt(byte[],int)"/><div class="member detail outer"><h3 class="member detail name">engineCrypt</h3><pre class="member detail synopsis">protected int engineCrypt(byte[] out,
int outOffset)</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Process data buffered by this cipher implementation.
<p/>
This method is overriden by ciphers that handle their own buffering
(i.e. <code>implBuffering == true</code>). It should flush the internal
buffer, and process any remaining data. By default, this method
returns 0.
<p/>
Ciphers that pass <code>implBuffering == false</code> to the superclass
constructor need not override this method.
<p/>
SECURITY: if array arguments are passed to native code, the
implementation must ensure that a buffer overflow or illegal memory
access cannot occur, <strong>regardless of the arguments passed to
this method</strong>. I.e. the native library should not be called if:
<pre>
out == null || outOffset <320 ||
(long)outOffset + (number of bytes to be written) > out.length
</pre>
<p/>
Note that the <code>(long)</code> cast is essential, because
<i>outOffset</i> could be close to <code>Integer.MAX_VALUE</code>.
The native method being called should be private. This is important
because untrusted code could subclass the cipher implementation, and
call this method directly with any arguments.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">out</code><span class="separator"> - </span><span class="description">the output buffer into which to write the result.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the number of bytes written.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineGetParameter(String)" id="engineGetParameter(String)"/><div class="member detail outer"><h3 class="member detail name">engineGetParameter</h3><pre class="member detail synopsis">protected Object engineGetParameter(String param)
throws <a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a>,
InvalidParameterException</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Gets the value of the specified algorithm parameter.
<p/>
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 block size, a source
of random bits for IV 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/>
The default implementation always throws a NoSuchParameterException.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">param</code><span class="separator"> - </span><span class="description">the string name of the parameter.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the object that represents the parameter value.</dd></dl></div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Throws:</b></dt><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a></code><span class="separator"> - </span><span class="description">if there is no parameter with name
param for this cipher implementation.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineInBufferSize(int,boolean)" id="engineInBufferSize(int,boolean)"/><div class="member detail outer"><h3 class="member detail name">engineInBufferSize</h3><pre class="member detail synopsis">protected int engineInBufferSize(int outLen,
boolean isFinal)</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Returns the minimum number of bytes of input, that
will cause an output of <i>outLen</i> bytes from a call to
<code>engineUpdate</code> (when <i>isFinal</i> is false), or
successive calls to both <code>engineUpdate</code> and
<code>engineCrypt</code> (when <i>isFinal</i> is true).
<p/>
If <code>implBuffering</code> is false, this method need not take
into account padding or buffered data when calculating the result.
In this case <code>outLen</code> will be a multiple of the output
block size (this may only be true for IJCE, not for other
implementations of JCE).
<p/>
The default implementation assumes that the output will have the
same number of blocks as the input (i.e. the result is
<code>outLen / getOutputBlockSize() * getInputBlockSize()</code>).
<p/>
You will need to override this method if the cipher handles its
own buffering.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">outLen</code><span class="separator"> - </span><span class="description">the number of bytes of output</span></dd><dd class="item"><code class="name">isFinal</code><span class="separator"> - </span><span class="description">whether the input includes the last block</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of the output block</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineInitDecrypt(Key)" id="engineInitDecrypt(Key)"/><div class="member detail outer"><h3 class="member detail name">engineInitDecrypt</h3><pre class="member detail synopsis">protected abstract void engineInitDecrypt(Key key)
throws KeyException</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Initializes this cipher for decryption, using the
specified key.
<p/>
After a call to this method, the cipher's state is set to DECRYPT.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">key</code><span class="separator"> - </span><span class="description">the key to use for decryption.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineInitEncrypt(Key)" id="engineInitEncrypt(Key)"/><div class="member detail outer"><h3 class="member detail name">engineInitEncrypt</h3><pre class="member detail synopsis">protected abstract void engineInitEncrypt(Key key)
throws KeyException</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Initializes this cipher for encryption, using the
specified key.
<p/>
After a call to this method, the cipher's state is set to ENCRYPT.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">key</code><span class="separator"> - </span><span class="description">the key to use for encryption.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineOutBufferSize(int,boolean)" id="engineOutBufferSize(int,boolean)"/><div class="member detail outer"><h3 class="member detail name">engineOutBufferSize</h3><pre class="member detail synopsis">protected int engineOutBufferSize(int inLen,
boolean isFinal)</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Returns the length of output buffer required for a given
length of input, in bytes. <code>isFinal</code> is true when this
is the final block of input.
<p/>
If <code>implBuffering</code> is false, the <code>inLen</code>
parameter already takes into account the length of any required
padding, and buffered data. In this case <code>inLen</code> will be
a multiple of the input block size (this may only be true for IJCE,
not for other implementations of JCE).
<p/>
The default implementation assumes that the output will have the
same number of blocks as the input (i.e. the result is
<code>inLen / getInputBlockSize() * getOutputBlockSize()</code>).
<p/>
You will need to override this method if the cipher handles its
own buffering.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the number of bytes of input</span></dd><dd class="item"><code class="name">isFinal</code><span class="separator"> - </span><span class="description">whether the last block is to be padded</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of the output block</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="enginePlaintextBlockSize()" id="enginePlaintextBlockSize()"/><div class="member detail outer"><h3 class="member detail name">enginePlaintextBlockSize</h3><pre class="member detail synopsis">protected int enginePlaintextBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Returns the length of a plaintext block, in bytes.
For byte-oriented stream ciphers, this method should return 1.
<p/>
The value may change when <code>initEncrypt</code> or
<code>initDecrypt</code> is called, but it should not change at
other times.
<p/>
The default implementation returns <code>engineBlockSize()</code>.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of a plaintext block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineSetPaddingScheme(xjava.security.PaddingScheme)" id="engineSetPaddingScheme(xjava.security.PaddingScheme)"/><div class="member detail outer"><h3 class="member detail name">engineSetPaddingScheme</h3><pre class="member detail synopsis">protected void engineSetPaddingScheme(<a href="../../xjava/security/PaddingScheme.html" title="Class in xjava.security">PaddingScheme</a> padding)</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Sets the object that will implement padding for this cipher.
<p/>
Cipher implementations may override this method in order to be notified
when the padding scheme is set (in this case they should always call
<code>super.engineSetPaddingScheme(padding)</code>). Normally, overriding
this method is not required.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineSetParameter(String,Object)" id="engineSetParameter(String,Object)"/><div class="member detail outer"><h3 class="member detail name">engineSetParameter</h3><pre class="member detail synopsis">protected void engineSetParameter(String param,
Object value)
throws <a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a>,
InvalidParameterException,
<a href="../../xjava/security/InvalidParameterTypeException.html" title="Class in xjava.security">InvalidParameterTypeException</a></pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: Sets the specified algorithm parameter to the specified
value.
<p/>
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 block size,
a source of random bits for IV 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/>
The default implementation always throws a NoSuchParameterException.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">param</code><span class="separator"> - </span><span class="description">the string name of the parameter.</span></dd><dd class="item"><code class="name">value</code><span class="separator"> - </span><span class="description">the parameter value.</span></dd></dl></div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Throws:</b></dt><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a></code><span class="separator"> - </span><span class="description">if there is no parameter with name
param for this cipher implementation.</span></dd><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/InvalidParameterTypeException.html" title="Class in xjava.security">InvalidParameterTypeException</a></code><span class="separator"> - </span><span class="description">if value is the wrong type
for this parameter.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="engineUpdate(byte[],int,int,byte[],int)" id="engineUpdate(byte[],int,int,byte[],int)"/><div class="member detail outer"><h3 class="member detail name">engineUpdate</h3><pre class="member detail synopsis">protected abstract int engineUpdate(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)</pre><blockquote class="member detail name"><div class="member detail description"> <b>SPI</b>: This is the main engine method for updating data.
<p/>
When <code>implBuffering</code> is true, this method will be called
with the same data that is passed to <code>update</code> or
<code>crypt</code> (i.e. there will be exactly one call to
<code>engineUpdate</code> for each call to <code>update</code> or
<code>crypt</code>).
<p/>
When <code>implBuffering</code> is false, the Cipher superclass will
ensure that when it calls this method, <i>inLen</i> is a non-negative
multiple of <code>getInputBlockSize()</code>.
<p/>
<i>in</i> and <i>out</i> may be the same array, and the input and
output regions may overlap. A cipher implementation <strong>should
not</strong> use any part of <i>in</i> or <i>out</i> as working storage
for intermediate steps of the algorithm. It should copy only the final
result into the <i>out</i> array.
<p/>
SECURITY: if array arguments are passed to native code, the
implementation must ensure that a buffer overflow or illegal memory
access cannot occur, <strong>regardless of the arguments passed to
this method</strong>. I.e. the native library should not be called if:
<pre>
in == null || out == null || inLen <320 || inLen % (block size) != 0 ||
inOffset <320 || (long)inOffset + inLen > in.length ||
outOffset <320 || (long)outOffset + (number of bytes to be written) > out.length
</pre>
<p/>
Note that the <code>(long)</code> casts are essential, because
<i>inOffset</i> or <i>outOffset</i> could be close to
<code>Integer.MAX_VALUE</code>. The native method being called
should be private. This is important because untrusted code could
subclass the cipher implementation, and call this method directly
with any arguments.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd><dd class="item"><code class="name">inOffset</code><span class="separator"> - </span><span class="description">the offset into <i>in</i> specifying where the
data starts.</span></dd><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the length of the subarray.</span></dd><dd class="item"><code class="name">out</code><span class="separator"> - </span><span class="description">the output array.</span></dd><dd class="item"><code class="name">outOffset</code><span class="separator"> - </span><span class="description">the offset indicating where to start writing into
the <i>out</i> array.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the number of bytes written.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getAlgorithm()" id="getAlgorithm()"/><div class="member detail outer"><h3 class="member detail name">getAlgorithm</h3><pre class="member detail synopsis">public final String getAlgorithm()</pre><blockquote class="member detail name"><div class="member detail description"> Returns this algorithm's standard cipher name (<em>not</em> including
mode and padding).
<p/>
See <a href="../guide/ijce/Algorithms.html#Cipher">
<cite>International JCE Standard Algorithm Names</cite></a> for a list
of Cipher algorithm names.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the standard cipher name (such as "DES").</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getAlgorithms()" id="getAlgorithms()"/><div class="member detail outer"><h3 class="member detail name">getAlgorithms</h3><pre class="member detail synopsis">public static String[] getAlgorithms()</pre><blockquote class="member detail name"><div class="member detail description"> Gets the standard names of all Ciphers implemented by any
installed provider. Algorithm names are not duplicated if
they are supported by more than one provider (but specialized
cipher/mode implementations are treated as distinct, for
example "DES/CBC" is different from "DES").
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
For compatibility you may wish to use
<code><a href="java.security.IJCE.html#getAlgorithms(java.lang.String)">
IJCE.getAlgorithms</a>("Cipher")</code> instead.
</div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>Since:</b></dt><dd>IJCE 1.0.1</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getAlgorithms(Provider)" id="getAlgorithms(Provider)"/><div class="member detail outer"><h3 class="member detail name">getAlgorithms</h3><pre class="member detail synopsis">public static String[] getAlgorithms(Provider provider)</pre><blockquote class="member detail name"><div class="member detail description"> Gets the standard names of all Ciphers implemented by a provider.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
For compatibility you may wish to use
<code><a href="java.security.IJCE.html#getAlgorithms(java.security.Provider, java.lang.String)">
IJCE.getAlgorithms</a>(provider, "Cipher")</code> instead.
</div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>Since:</b></dt><dd>IJCE 1.0.1</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getCiphertextBlockSize()" id="getCiphertextBlockSize()"/><div class="member detail outer"><h3 class="member detail name">getCiphertextBlockSize</h3><pre class="member detail synopsis">public final int getCiphertextBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the length of a ciphertext block, in bytes.
For byte-oriented stream ciphers, this method returns 1.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of a ciphertext block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getInputBlockSize()" id="getInputBlockSize()"/><div class="member detail outer"><h3 class="member detail name">getInputBlockSize</h3><pre class="member detail synopsis">public final int getInputBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the length of an input block, in bytes. When the cipher is
in encryption mode, this is the length of a plaintext block. When in
decryption mode, it is the length of a ciphertext block.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of an input block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getInstance(String)" id="getInstance(String)"/><div class="member detail outer"><h3 class="member detail name">getInstance</h3><pre class="member detail synopsis">public static <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a> getInstance(String algorithm)
throws NoSuchAlgorithmException</pre><blockquote class="member detail name"><div class="member detail description"> Generates a Cipher object that implements the given algorithm. If the
default provider package contains a class implementing the algorithm,
an instance of that class is returned. If it is not available in the
default package, other packages are searched.
<p/>
Any of the following formats can be used for the algorithm name:
<p/>
<dl>
<dt></dt><dd></dd><dt></dt><dd></dd><dt></dt><dd></dd></dl>
<p/>
See <a href="../guide/ijce/Algorithms.html#Cipher">
<cite>International JCE Standard Algorithm Names</cite></a> for a list
of Cipher algorithm names.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">algorithm</code><span class="separator"> - </span><span class="description">the algorithm name, as described above.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the new Cipher object, in the UNINITIALIZED state.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getInstance(String,String)" id="getInstance(String,String)"/><div class="member detail outer"><h3 class="member detail name">getInstance</h3><pre class="member detail synopsis">public static <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a> getInstance(String algorithm,
String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException</pre><blockquote class="member detail name"><div class="member detail description"> Generates a Cipher object that implements the given cipher, from
the given provider. The format of the cipher specification is as
described for <code>getInstance(String algorithm)</code>.
<p/>
If the algorithm is implemented using more than one component
(cipher, mode, and padding scheme), all of them must come from the
given provider. More flexibility can be obtained by using the
<code>getInstance(Cipher, Mode, PaddingScheme)</code> factory method.
For example, to request "DES" from the SUN provider, "CBC" from the
Cryptix provider, and "PKCS#5" from any provider, use:
<pre>
Cipher.getInstance(
Cipher.getInstance("DES", "SUN"),
Mode.getInstance("CBC", "Cryptix"),
PaddingScheme.getInstance("PKCS#5")
)
</pre>
<p/>
See <a href="../guide/ijce/Algorithms.html#Cipher">
<cite>International JCE Standard Algorithm Names</cite></a> for a list
of Cipher algorithm names.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">algorithm</code><span class="separator"> - </span><span class="description">the cipher specification.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the new Cipher object, in the UNINITIALIZED state.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getInstance(xjava.security.Cipher,xjava.security.Mode,xjava.security.PaddingScheme)" id="getInstance(xjava.security.Cipher,xjava.security.Mode,xjava.security.PaddingScheme)"/><div class="member detail outer"><h3 class="member detail name">getInstance</h3><pre class="member detail synopsis">public static <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a> getInstance(<a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a> cipher,
<a href="../../xjava/security/Mode.html" title="Class in xjava.security">Mode</a> mode,
<a href="../../xjava/security/PaddingScheme.html" title="Class in xjava.security">PaddingScheme</a> padding)</pre><blockquote class="member detail name"><div class="member detail description"> Generates a new Cipher object by composing the given Cipher, Mode and
PaddingScheme objects. <i>mode</i> may be null (indicating ECB),
and <i>padding</i> may be null (indicating NONE).
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getMode()" id="getMode()"/><div class="member detail outer"><h3 class="member detail name">getMode</h3><pre class="member detail synopsis">public final String getMode()</pre><blockquote class="member detail name"><div class="member detail description"> Returns this algorithm's standard mode name.
<p/>
See <a href="../guide/ijce/Algorithms.html#Mode">
<cite>International JCE Standard Algorithm Names</cite></a> for a list
of Mode algorithm names.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the algorithm's standard mode name (such as "CBC")</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getOutputBlockSize()" id="getOutputBlockSize()"/><div class="member detail outer"><h3 class="member detail name">getOutputBlockSize</h3><pre class="member detail synopsis">public final int getOutputBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the length of an output block, in bytes. When the cipher is
in encryption mode, this is the length of a ciphertext block. When in
decryption mode, it is the length of a plaintext block.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of an output block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getPadding()" id="getPadding()"/><div class="member detail outer"><h3 class="member detail name">getPadding</h3><pre class="member detail synopsis">public final String getPadding()</pre><blockquote class="member detail name"><div class="member detail description"> Returns this algorithm's standard padding scheme name.
<p/>
See <a href="../guide/ijce/Algorithms.html#PaddingScheme">
<cite>International JCE Standard Algorithm Names</cite></a> for a list
of PaddingScheme algorithm names.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the algorithm's standard padding scheme name (such as
"PKCS#7" or "NONE")</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getPaddingScheme()" id="getPaddingScheme()"/><div class="member detail outer"><h3 class="member detail name">getPaddingScheme</h3><pre class="member detail synopsis">protected final <a href="../../xjava/security/PaddingScheme.html" title="Class in xjava.security">PaddingScheme</a> getPaddingScheme()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the object implementing padding for this cipher, or null if
there is no such object.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getParameter(String)" id="getParameter(String)"/><div class="member detail outer"><h3 class="member detail name">getParameter</h3><pre class="member detail synopsis">public Object getParameter(String param)
throws <a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a>,
InvalidParameterException</pre><blockquote class="member detail name"><div class="member detail description"> Gets the value of the specified algorithm parameter.
<p/>
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 block size,
a source of random bits for IV 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/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><dl class="member detail specified by list"><dt class="member detail specified by header"><b>Specified by:</b></dt><dd class="member detail specified by item"><a href="../../xjava/security/Parameterized.html#getParameter(String)">getParameter</a> in interface <a href="../../xjava/security/Parameterized.html" title="Interface in xjava.security">Parameterized</a></dd></dl><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">param</code><span class="separator"> - </span><span class="description">the string name of the parameter.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the object that represents the parameter value.</dd></dl></div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Throws:</b></dt><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a></code><span class="separator"> - </span><span class="description">if there is no parameter with name
param for this cipher implementation.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getPlaintextBlockSize()" id="getPlaintextBlockSize()"/><div class="member detail outer"><h3 class="member detail name">getPlaintextBlockSize</h3><pre class="member detail synopsis">public final int getPlaintextBlockSize()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the length of a plaintext block, in bytes.
For byte-oriented stream ciphers, this method returns 1.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the length in bytes of a plaintext block for this cipher.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getProvider()" id="getProvider()"/><div class="member detail outer"><h3 class="member detail name">getProvider</h3><pre class="member detail synopsis">public final String getProvider()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the name of the provider of this cipher.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the provider name (such as "SUN" or "Cryptix")</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="getState()" id="getState()"/><div class="member detail outer"><h3 class="member detail name">getState</h3><pre class="member detail synopsis">public final int getState()</pre><blockquote class="member detail name"><div class="member detail description"> Returns the state of this Cipher object. Possible states are:
<p/>
<dl>
<dt></dt><dd></dd><dt></dt><dd></dd><dt></dt><dd></dd></dl>
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the state of this cipher object.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><a href="../../xjava/security/Cipher.html#UNINITIALIZED"><code>UNINITIALIZED</code></a>, <a href="../../xjava/security/Cipher.html#ENCRYPT"><code>ENCRYPT</code></a>, <a href="../../xjava/security/Cipher.html#DECRYPT"><code>DECRYPT</code></a></dd></dl></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="inBufferSize(int)" id="inBufferSize(int)"/><div class="member detail outer"><h3 class="member detail name">inBufferSize</h3><pre class="member detail synopsis">public final int inBufferSize(int outLen)</pre><blockquote class="member detail name"><div class="member detail description"> Returns the minimum number of bytes of input, that will cause an
output of <i>outLen</i> bytes from a call to <code>update</code> (i.e.
not including padding). This call takes into account any incomplete
block currently being buffered.
<p/>
This is used by <samp>CipherInputStream</samp>, for example, to
calculate how much data must be read from its underlying stream before
encryption or decryption.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">outLen</code><span class="separator"> - </span><span class="description">the number of bytes of output required.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="inBufferSizeFinal(int)" id="inBufferSizeFinal(int)"/><div class="member detail outer"><h3 class="member detail name">inBufferSizeFinal</h3><pre class="member detail synopsis">public final int inBufferSizeFinal(int outLen)</pre><blockquote class="member detail name"><div class="member detail description"> Returns the minimum number of bytes of input, that will cause an
output of <i>outLen</i> bytes from a call to <code>crypt</code>
(including padding for the final block of the stream, if applicable).
This call takes into account any incomplete block currently being
buffered.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">outLen</code><span class="separator"> - </span><span class="description">the number of bytes of output required.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="initDecrypt(Key)" id="initDecrypt(Key)"/><div class="member detail outer"><h3 class="member detail name">initDecrypt</h3><pre class="member detail synopsis">public final void initDecrypt(Key key)
throws KeyException</pre><blockquote class="member detail name"><div class="member detail description"> Initializes this cipher for decryption, using the specified
key. A successful call to this method puts the cipher in the
DECRYPT state. This method may be called on a cipher in any
state. Any state information (key, feedback buffer, ...) is
lost and reset.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">key</code><span class="separator"> - </span><span class="description">the key to use for decryption.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="initEncrypt(Key)" id="initEncrypt(Key)"/><div class="member detail outer"><h3 class="member detail name">initEncrypt</h3><pre class="member detail synopsis">public final void initEncrypt(Key key)
throws KeyException</pre><blockquote class="member detail name"><div class="member detail description"> Initializes this cipher for encryption, using the specified
key. A successful call to this method puts the cipher in the
ENCRYPT state. This method may be called on a cipher in any
state. Any state information (key, feedback buffer, ...) is
lost and reset.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">key</code><span class="separator"> - </span><span class="description">the key to use for encryption.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="isPaddingBlockCipher()" id="isPaddingBlockCipher()"/><div class="member detail outer"><h3 class="member detail name">isPaddingBlockCipher</h3><pre class="member detail synopsis">public final boolean isPaddingBlockCipher()</pre><blockquote class="member detail name"><div class="member detail description"> Returns true if this cipher is a padding block cipher.
<p/>
A cipher is a padding block cipher iff <code>getPlaintextBlockSize() > 1
&& getPaddingScheme() != null</code>.
If getPlaintextBlockSize throws an exception, so will this method.
<p/>
This method is needed because
<samp><a href="java.security.CipherInputStream.html">CipherInputStream</a></samp> and
<samp><a href="java.security.CipherOutputStream.html">CipherOutputStream</a></samp>
use a different buffering algorithm for padding block ciphers.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="outBufferSize(int)" id="outBufferSize(int)"/><div class="member detail outer"><h3 class="member detail name">outBufferSize</h3><pre class="member detail synopsis">public final int outBufferSize(int inLen)</pre><blockquote class="member detail name"><div class="member detail description"> Returns the size of the buffer necessary to hold the output
resulting from a call to <code>update</code> (i.e. not including
padding). This call takes into account any incomplete block
currently being buffered.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the number of bytes to process.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="outBufferSizeFinal(int)" id="outBufferSizeFinal(int)"/><div class="member detail outer"><h3 class="member detail name">outBufferSizeFinal</h3><pre class="member detail synopsis">public final int outBufferSizeFinal(int inLen)</pre><blockquote class="member detail name"><div class="member detail description"> Returns the size of the buffer necessary to hold the output
resulting from a call to <code>crypt</code> (including padding
for the final block of the stream, if applicable). This call takes
into account any incomplete block currently being buffered.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the number of bytes to process.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="setParameter(String,Object)" id="setParameter(String,Object)"/><div class="member detail outer"><h3 class="member detail name">setParameter</h3><pre class="member detail synopsis">public void setParameter(String param,
Object value)
throws <a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a>,
InvalidParameterException,
<a href="../../xjava/security/InvalidParameterTypeException.html" title="Class in xjava.security">InvalidParameterTypeException</a></pre><blockquote class="member detail name"><div class="member detail description"> Sets the specified algorithm parameter to the specified value.
<p/>
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 block size,
a source of random bits for IV 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/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong>
</div><dl class="member detail specified by list"><dt class="member detail specified by header"><b>Specified by:</b></dt><dd class="member detail specified by item"><a href="../../xjava/security/Parameterized.html#setParameter(String,Object)">setParameter</a> in interface <a href="../../xjava/security/Parameterized.html" title="Interface in xjava.security">Parameterized</a></dd></dl><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">param</code><span class="separator"> - </span><span class="description">the string identifier of the parameter.</span></dd><dd class="item"><code class="name">value</code><span class="separator"> - </span><span class="description">the parameter value.</span></dd></dl></div><div class="member detail thrown list"><dl><dt class="member detail thrown header"><b>Throws:</b></dt><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/NoSuchParameterException.html" title="Class in xjava.security">NoSuchParameterException</a></code><span class="separator"> - </span><span class="description">if there is no parameter with name
param for this cipher implementation.</span></dd><dd class="member detail thrown item"><code class="name"><a href="../../xjava/security/InvalidParameterTypeException.html" title="Class in xjava.security">InvalidParameterTypeException</a></code><span class="separator"> - </span><span class="description">if value is the wrong type
for this parameter.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="toString()" id="toString()"/><div class="member detail outer"><h3 class="member detail name">toString</h3><pre class="member detail synopsis">public String toString()</pre><blockquote class="member detail name"><div class="member detail description"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="update(byte[])" id="update(byte[])"/><div class="member detail outer"><h3 class="member detail name">update</h3><pre class="member detail synopsis">public final byte[] update(byte[] in)</pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified array of data, which is not the
final data in this stream. For block ciphers, if the last block so
far is incomplete, it will be buffered and processed in subsequent
calls to <code>update</code> or <code>crypt</code>.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state. This method will automatically allocate
an output buffer of the right size.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the encryption or decryption result.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="update(byte[],int,int)" id="update(byte[],int,int)"/><div class="member detail outer"><h3 class="member detail name">update</h3><pre class="member detail synopsis">public final byte[] update(byte[] in,
int offset,
int length)</pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified subarray of data, which is not the
final data in this stream. For block ciphers, if the last block so
far is incomplete, it will be buffered and processed in subsequent
calls to <code>update</code> or <code>crypt</code>.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state. This method will automatically allocate
an output buffer of the right size.
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd><dd class="item"><code class="name">offset</code><span class="separator"> - </span><span class="description">the offset indicating where the subarray starts in the
<i>in</i> array.</span></dd><dd class="item"><code class="name">length</code><span class="separator"> - </span><span class="description">the length of the subarray.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the encryption or decryption result.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="update(byte[],int,int,byte[])" id="update(byte[],int,int,byte[])"/><div class="member detail outer"><h3 class="member detail name">update</h3><pre class="member detail synopsis">public final int update(byte[] in,
int inOffset,
int inLen,
byte[] out)</pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified subarray of data, which is not the
final data in this stream, and places the result in the specified
output buffer (starting at offset 0). For block ciphers, if the last
block so far is incomplete, it will be buffered and processed in
subsequent calls to <code>update</code> or <code>crypt</code>.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state. <code>out.length</code> must be at least
<code>outBufferSize(inLen)</code>, otherwise an
ArrayIndexOutOfBoundsException will be thrown (in this case it is
not specified how much, if any, of the output will have been written).
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd><dd class="item"><code class="name">inOffset</code><span class="separator"> - </span><span class="description">the offset indicating where the subarray starts in
the <i>in</i> array.</span></dd><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the length of the subarray.</span></dd><dd class="item"><code class="name">out</code><span class="separator"> - </span><span class="description">the output buffer.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the number of bytes written.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="update(byte[],int,int,byte[],int)" id="update(byte[],int,int,byte[],int)"/><div class="member detail outer"><h3 class="member detail name">update</h3><pre class="member detail synopsis">public final int update(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)</pre><blockquote class="member detail name"><div class="member detail description"> Encrypts or decrypts the specified subarray of data, which is not the
final data in this stream, and places the result in the specified
output buffer. For block ciphers, if the last block so far is
incomplete, it will be buffered and processed in subsequent calls to
<code>update</code> or <code>crypt</code>.
<p/>
Whether the data is encrypted or decrypted depends on the cipher's
initialization state. <code>out.length</code> must be at least
<code>(long) outOffset + outBufferSize(inLen)</code>, otherwise an
ArrayIndexOutOfBoundsException will be thrown (in this case it is
not specified how much, if any, of the output will have been written).
<p/>
<strong><a href="../guide/ijce/JCEDifferences.html">This method
is not supported in JavaSoft's version of JCE.</a></strong> However,
an equivalent method is declared in the JCE 1.2 preview documentation
for <samp>javax.crypto.Cipher</samp>.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">in</code><span class="separator"> - </span><span class="description">the input data.</span></dd><dd class="item"><code class="name">inOffset</code><span class="separator"> - </span><span class="description">the offset indicating where the subarray starts in
the <i>in</i> array.</span></dd><dd class="item"><code class="name">inLen</code><span class="separator"> - </span><span class="description">the length of the subarray.</span></dd><dd class="item"><code class="name">out</code><span class="separator"> - </span><span class="description">the output buffer.</span></dd><dd class="item"><code class="name">outOffset</code><span class="separator"> - </span><span class="description">the offset indicating where to start writing the
result into the output buffer.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the number of bytes written.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div></div><p class="navbar bottom spacer"> </p><table class="navbar div bottom"><tr><td><div class="navbar div top"><span class="navbar item enabled"><a href="../../overview-summary.html">Overview</a></span> <span class="navbar item enabled"><a href="package-summary.html">Package</a></span> <span class="navbar item enabled"><a href="tree.html">Tree</a></span> <span class="navbar item enabled"><a href="../../alphaindex.html">Index</a></span> <span class="navbar item enabled"><a href="../../deprecated.html">Deprecated</a></span> <span class="navbar item enabled"><a href="../../about.html">About</a></span></div></td></tr></table></body></html>