コード例 #1
0
 // see JCE spec
 protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
     throws InvalidKeyException, InvalidAlgorithmParameterException {
   byte[] ivValue;
   if (params != null) {
     if (params instanceof IvParameterSpec == false) {
       throw new InvalidAlgorithmParameterException("Only IvParameterSpec supported");
     }
     IvParameterSpec ivSpec = (IvParameterSpec) params;
     ivValue = ivSpec.getIV();
   } else {
     ivValue = null;
   }
   implInit(opmode, key, ivValue, random);
 }
コード例 #2
0
 // see JCE spec
 protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
     throws InvalidKeyException, InvalidAlgorithmParameterException {
   byte[] ivValue;
   if (params != null) {
     try {
       IvParameterSpec ivSpec = (IvParameterSpec) params.getParameterSpec(IvParameterSpec.class);
       ivValue = ivSpec.getIV();
     } catch (InvalidParameterSpecException e) {
       throw new InvalidAlgorithmParameterException("Could not decode IV", e);
     }
   } else {
     ivValue = null;
   }
   implInit(opmode, key, ivValue, random);
 }