public static DefaultCipherProvider getInstance() { if (instance != null) { return instance; } instance = new DefaultCipherProvider(); return instance; }
@Override public Cipher getCipher(String name) { if (name.equalsIgnoreCase("AES")) { return new AES(this); } throw new RuntimeException("Cipher '" + name + "' is not supported by provider '" + getName() + "'"); }
@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", "TestRNG", aes.getRNG().getAlgorithm()); }
@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", "TestRNG", aes.getRNG().getAlgorithm()); }
public static DefaultCipherProvider getInstance() { if (instance != null) { return instance; } instance = new DefaultCipherProvider(); return instance; }
@Override public Cipher getCipher(String name) { if (name.equalsIgnoreCase("AES")) { return new AES(this); } throw new RuntimeException("Cipher '" + name + "' is not supported by provider '" + getName() + "'"); }
@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", "TestRNG", aes.getRNG().getAlgorithm()); }
public static DefaultCipherProvider getInstance() { if (instance != null) { return instance; } instance = new DefaultCipherProvider(); return instance; }
@Override public Cipher getCipher(String name) { if (name.equalsIgnoreCase("AES")) { return new AES(this); } throw new RuntimeException("Cipher '" + name + "' is not supported by provider '" + getName() + "'"); }
@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", "TestRNG", aes.getRNG().getAlgorithm()); }
public static DefaultCipherProvider getInstance() { if (instance != null) { return instance; } instance = new DefaultCipherProvider(); return instance; }
@Override public Cipher getCipher(String name) { if (name.equalsIgnoreCase("AES")) { return new AES(this); } throw new RuntimeException("Cipher '" + name + "' is not supported by provider '" + getName() + "'"); }
@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", "TestRNG", aes.getRNG().getAlgorithm()); }
@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", "TestRNG", aes.getRNG().getAlgorithm()); }