Package org.bouncycastle.crypto.engines

Examples of org.bouncycastle.crypto.engines.AESEngine


    super(id, algorithm, keySize, ivSize, needsUnlimitedStrength);
  }
   
  @Override
  public OutputStream newCipherOutputStream(OutputStream underlyingOutputStream, byte[] secretKey, byte[] iv) throws CipherException {
    AEADBlockCipher cipher = new GCMBlockCipher(new AESEngine());
    cipher.init(true, new AEADParameters(new KeyParameter(secretKey), MAC_SIZE, iv));
   
    return new org.bouncycastle.crypto.io.CipherOutputStream(underlyingOutputStream, cipher);
  }
View Full Code Here


    return new org.bouncycastle.crypto.io.CipherOutputStream(underlyingOutputStream, cipher);
  }

  @Override
  public InputStream newCipherInputStream(InputStream underlyingInputStream, byte[] secretKey, byte[] iv) throws CipherException {
    AEADBlockCipher cipher = new GCMBlockCipher(new AESEngine());
    cipher.init(false, new AEADParameters(new KeyParameter(secretKey), MAC_SIZE, iv));
   
    return new org.bouncycastle.crypto.io.CipherInputStream(underlyingInputStream, cipher);
  }
View Full Code Here

   * @return The AES cipher.
   */
  public static AESEngine createCipher(final SecretKey secretKey,
                                 final boolean forEncryption) {

    AESEngine cipher = new AESEngine();

    CipherParameters cipherParams = new KeyParameter(secretKey.getEncoded());

    cipher.init(forEncryption, cipherParams);

    return cipher;
  }
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.engines.AESEngine

Copyright © 2018 www.massapicom. 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.