protected AlgorithmParameterSpec createParameterSpec(byte[] iv, boolean streaming) {
        return new IvParameterSpec(iv);
    }
Initializes the JDK Cipher with the specified mode and key.  This is primarily a utility method to catch any
potential {@link java.security.InvalidKeyException InvalidKeyException} that might arise.

@param cipher the JDK Cipher to {@link javax.crypto.Cipher#init(int, java.security.Key) init}.
@param mode   the Cipher mode
@param key    the Cipher's Key
@param spec   the JDK AlgorithmParameterSpec for cipher initialization (optional, may be null).
@param random the SecureRandom to use for cipher initialization (optional, may be null).
@throws CryptoException if the key is invalid
src/main/java/org/apache/shiro/crypto/cipher/JcaCipherService.java