- opmode
- the operation this cipher instance should be initialized for (one of: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE).
- key
- the input key for the operation.
- random
- the source of randomness to use.
Type Reason Java.Security.InvalidKeyException if the specified key cannot be used to initialize this cipher instance.
Initializes this cipher instance with the specified key and a source of randomness.
The cipher will be initialized for the specified operation (one of: encryption, decryption, key wrapping or key unwrapping) depending on opmode.
If this cipher instance needs any algorithm parameters or random values that the specified key cannot provide, the underlying implementation of this cipher is supposed to generate the required parameters (using its provider or random values). Random values will be generated using random;
When a cipher instance is initialized by a call to any of the init methods, the state of the instance is overridden, means it is equivalent to creating a new instance and calling it init method.