code: Cipher forMode(int ciphermode, SecretKey key, AlgorithmParameterSpec params) {
  		final Cipher cipher = threadLocal.get();
  		try {
  			cipher.init(ciphermode, key, params);
  			return cipher;
  		} catch (InvalidKeyException e) {
  			throw new IllegalArgumentException("Invalid key.", e);
  		} catch (InvalidAlgorithmParameterException e) {
  			throw new IllegalArgumentException("Algorithm parameter not appropriate for " + cipher.getAlgorithm() + ".", e);
  		}
  	}
docs: visible for testing