protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { if (params instanceof BlockCipherParameterSpec) { if (((BlockCipherParameterSpec) params).getBlockSize() != 16) { throw new InvalidAlgorithmParameterException("AES block size must be 16 bytes"); } } super.engineInit(opmode, key, params, random); }
protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { if (!(key instanceof PBEKey)) throw new InvalidKeyException("not a PBE key"); super.engineInit(opmode, genkey((PBEKey) key), params, random); }
protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException { if (!(key instanceof PBEKey)) throw new InvalidKeyException("not a PBE key"); super.engineInit(opmode, genkey((PBEKey) key), random); }