@Test void generateWithStrengthParameter() { KeyGenerationParameters params = new GenericKeyGenerationParameters(128); byte[] key = generator.generate(params); assertThat(key.length, equalTo(128)); assertThat(key, not(equalTo(generator.generate(params)))); assertThat(generator.generate(new GenericKeyGenerationParameters(16)).length, equalTo(16)); }
@Override public byte[] generate() { throw new UnsupportedOperationException("Knowing the key strength is required to generate a key."); }
DefaultKeyGenerator implements KeyGenerator { @Override public byte[] generate() { throw new UnsupportedOperationException("Knowing the key strength is required to generate a key."); } }
DefaultKeyGenerator implements KeyGenerator { @Override public byte[] generate() { throw new UnsupportedOperationException("Knowing the key strength is required to generate a key."); }  }
DefaultKeyGenerator implements KeyGenerator { @Override public byte[] generate() { throw new UnsupportedOperationException("Knowing the key strength is required to generate a key."); }  @Override byte[] generate(); @Override byte[] generate(KeyGenerationParameters parameters); }
DefaultKeyGenerator implements KeyGenerator { @Override public byte[] generate() { throw new UnsupportedOperationException("Knowing the key strength is required to generate a key."); }  @Override byte[] generate(); @Override byte[] generate(KeyGenerationParameters parameters);  }