use of com.quorum.tessera.encryption.Encryptor in project tessera by ConsenSys.
the class KaliumFactoryTest method createInstance.
@Test
public void createInstance() {
final Encryptor result = this.kaliumFactory.create();
assertThat(kaliumFactory.getType()).isEqualTo("CUSTOM");
assertThat(result).isNotNull().isExactlyInstanceOf(Kalium.class);
}
use of com.quorum.tessera.encryption.Encryptor in project tessera by ConsenSys.
the class AWSSecretManagerKeyGeneratorTest method setUp.
@Before
public void setUp() {
final Encryptor encryptor = mock(Encryptor.class);
this.keyVaultService = mock(KeyVaultService.class);
final KeyPair keyPair = new KeyPair(pub, priv);
when(encryptor.generateNewKeys()).thenReturn(keyPair);
awsSecretManagerKeyGenerator = new AWSSecretManagerKeyGenerator(encryptor, keyVaultService);
}
use of com.quorum.tessera.encryption.Encryptor in project tessera by ConsenSys.
the class FileKeyGeneratorTest method init.
@Before
public void init() {
this.keyPair = new KeyPair(PublicKey.from(PUBLIC_KEY.getBytes(UTF_8)), PrivateKey.from(PRIVATE_KEY.getBytes(UTF_8)));
this.encryptor = mock(Encryptor.class);
this.keyEncryptor = mock(KeyEncryptor.class);
this.passwordReader = mock(PasswordReader.class);
when(passwordReader.requestUserPassword()).thenReturn(new char[0]);
this.generator = new FileKeyGenerator(encryptor, keyEncryptor, passwordReader);
}
use of com.quorum.tessera.encryption.Encryptor in project tessera by ConsenSys.
the class ConfigGenerator method keyLookup.
private static Map<Integer, SortedMap<String, String>> keyLookup(EncryptorType encryptorType) {
final Encryptor encryptor = transaction.utils.Utils.getEncryptor(encryptorType);
return new HashMap<Integer, SortedMap<String, String>>() {
{
put(1, new TreeMap<String, String>() {
KeyPair pair = encryptor.generateNewKeys();
{
put(pair.getPublicKey().encodeToBase64(), pair.getPrivateKey().encodeToBase64());
}
});
put(2, new TreeMap<String, String>() {
KeyPair pair = encryptor.generateNewKeys();
{
put(pair.getPublicKey().encodeToBase64(), pair.getPrivateKey().encodeToBase64());
}
});
put(3, new TreeMap<String, String>() {
KeyPair pair = encryptor.generateNewKeys();
KeyPair pair2 = encryptor.generateNewKeys();
{
put(pair.getPublicKey().encodeToBase64(), pair.getPrivateKey().encodeToBase64());
put(pair2.getPublicKey().encodeToBase64(), pair2.getPrivateKey().encodeToBase64());
}
});
put(4, new TreeMap<String, String>() {
KeyPair pair = encryptor.generateNewKeys();
{
put(pair.getPublicKey().encodeToBase64(), pair.getPrivateKey().encodeToBase64());
}
});
}
};
}
Aggregations