Code example for AlgorithmParameters

Methods: getEncoded

0
            fail("JCE decrypt with additional data and GCMParameterSpec failed."); 
        } 
 
        AlgorithmParameters algParams = eax.getParameters();
 
        byte[] encParams = algParams.getEncoded();
 
        GCMParameters gcmParameters = GCMParameters.getInstance(encParams);
 
        if (!Arrays.areEqual(spec.getIV(), gcmParameters.getNonce()) || spec.getTLen() != gcmParameters.getIcvLen())
        { 
            fail("parameters mismatch"); 
        } 
    } 
 
    private void testGCMParameterSpecWithMultipleUpdates(byte[] K,
                                      byte[] N,
                                      byte[] A,
                                      byte[] P,
                                      byte[] C)