public final void init(int opmode, Key key) throws InvalidKeyException {
        init(opmode, key, JceSecurity.RANDOM);
    }
public final void init ( int opmode , Key key ) throws InvalidKeyException { init ( opmode , key , JceSecurity . RANDOM ) ; }
Initializes this cipher with a key.

<p>The cipher is initialized for one of the following four operations:
encryption, decryption, key wrapping or key unwrapping, depending
on the value of <code>opmode</code>.

<p>If this cipher requires any algorithm parameters that cannot be
derived from the given <code>key</code>, the underlying cipher
implementation is supposed to generate the required parameters itself
(using provider-specific default or random values) if it is being
initialized for encryption or key wrapping, and raise an
<code>InvalidKeyException</code> if it is being
initialized for decryption or key unwrapping.
The generated parameters can be retrieved using
{@link #getParameters() getParameters} or
{@link #getIV() getIV} (if the parameter is an IV).

<p>If this cipher requires algorithm parameters that cannot be
derived from the input parameters, and there are no reasonable
provider-specific default values, initialization will
necessarily fail.

<p>If this cipher (including its underlying feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them using the {@link SecureRandom <code>SecureRandom</code>}
implementation of the highest-priority
installed provider as the source of randomness.
(If none of the installed providers supply an implementation of
SecureRandom, a system-provided source of randomness will be used.)

<p>Note that when a Cipher object is initialized, it loses all
previously-acquired state. In other words, initializing a Cipher is
equivalent to creating a new instance of that Cipher and initializing
it.

@param opmode the operation mode of this cipher (this is one of
the following:
<code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
<code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
@param key the key

@exception InvalidKeyException if the given key is inappropriate for
initializing this cipher, or requires
algorithm parameters that cannot be
determined from the given key, or if the given key has a keysize that
exceeds the maximum allowable keysize (as determined from the
configured jurisdiction policy files).