@Test public void testAlternateRNG() throws Exception { Security.addProvider(new TestProvider()); Configuration conf = new Configuration(); conf.set(AES.RNG_ALGORITHM_KEY, "TestRNG"); conf.set(AES.RNG_PROVIDER_KEY, "TEST"); DefaultCipherProvider.getInstance().setConf(conf); AES aes = new AES(DefaultCipherProvider.getInstance()); assertEquals("AES did not find alternate RNG", aes.getRNG().getAlgorithm(), "TestRNG"); }
@VisibleForTesting SecureRandom getRNG() { return rng; }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } AES(CipherProvider provider); }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } AES(CipherProvider provider); @Override String getName(); @Override int getKeyLength(); @Override int getIvLength(); @Override Key getRandomKey(); @Override Encryptor getEncryptor(); @Override Decryptor getDecryptor(); @Override OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv); @Override OutputStream createEncryptionStream(OutputStream out, Encryptor e); @Override InputStream createDecryptionStream(InputStream in, Context context, byte[] iv); @Override InputStream createDecryptionStream(InputStream in, Decryptor d); }
AES extends Cipher { @VisibleForTesting SecureRandom getRNG() { return rng; } AES(CipherProvider provider); @Override String getName(); @Override int getKeyLength(); @Override int getIvLength(); @Override Key getRandomKey(); @Override Encryptor getEncryptor(); @Override Decryptor getDecryptor(); @Override OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv); @Override OutputStream createEncryptionStream(OutputStream out, Encryptor e); @Override InputStream createDecryptionStream(InputStream in, Context context, byte[] iv); @Override InputStream createDecryptionStream(InputStream in, Decryptor d); static final int KEY_LENGTH; static final int KEY_LENGTH_BITS; static final int IV_LENGTH; static final String CIPHER_MODE_KEY; static final String CIPHER_PROVIDER_KEY; static final String RNG_ALGORITHM_KEY; static final String RNG_PROVIDER_KEY; }