Package org.bouncycastle.crypto.modes

Examples of org.bouncycastle.crypto.modes.GCMBlockCipher.doFinal()


    int outputOffset = cipher.processBytes(plainText, 0, plainText.length, output, 0);


    // Produce authentication tag
    try {
      outputOffset += cipher.doFinal(output, outputOffset);

    } catch (InvalidCipherTextException e) {

      throw new RuntimeException("Couldn't generate GCM authentication tag: " + e.getMessage(), e);
    }
View Full Code Here


    // Decrypt
    int outputOffset = cipher.processBytes(input, 0, input.length, output, 0);

    // Validate authentication tag
    try {
      outputOffset += cipher.doFinal(output, outputOffset);
       
    } catch (InvalidCipherTextException e) {

      throw new RuntimeException("Couldn't validate GCM authentication tag: " + e.getMessage(), e);
    }
View Full Code Here

    // Produce cipher text
    int outputOffset = gcm.processBytes(cek.getEncoded(), 0, cek.getEncoded().length, output, 0);

    // Produce authentication tag
    try {
      outputOffset += gcm.doFinal(output, outputOffset);

    } catch (InvalidCipherTextException e) {

      throw new JOSEException("Couldn't generate GCM authentication tag for key: " + e.getMessage(), e);
    }
View Full Code Here

    int keyBytesOffset = gcm.processBytes(input, 0, input.length, keyBytes, 0);


    // Validate authentication tag
    try {
      keyBytesOffset += gcm.doFinal(keyBytes, keyBytesOffset);

    } catch (InvalidCipherTextException e) {

      throw new JOSEException("Couldn't validate GCM authentication tag: " + e.getMessage(), e);
    }
View Full Code Here

    int outputOffset = cipher.processBytes(plainText, 0, plainText.length, output, 0);


    // Produce authentication tag
    try {
      outputOffset += cipher.doFinal(output, outputOffset);

    } catch (InvalidCipherTextException e) {

      throw new JOSEException("Couldn't generate GCM authentication tag: " + e.getMessage(), e);
    }
View Full Code Here

    // Decrypt
    int outputOffset = cipher.processBytes(input, 0, input.length, output, 0);

    // Validate authentication tag
    try {
      outputOffset += cipher.doFinal(output, outputOffset);
       
    } catch (InvalidCipherTextException e) {

      throw new JOSEException("Couldn't validate GCM authentication tag: " + e.getMessage(), e);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.