Examples of AESEngine


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

Examples of org.bouncycastle.crypto.engines.AESEngine

    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

Examples of org.bouncycastle.crypto.engines.AESEngine

   * @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

Examples of org.bouncycastle2.crypto.engines.AESEngine

    public static class RFC3211Wrap
        extends WrapCipherSpi
    {
        public RFC3211Wrap()
        {
            super(new RFC3211WrapEngine(new AESEngine()), 16);
        }
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.