use of com.quorum.tessera.config.KeyData in project tessera by ConsenSys.
the class KeyDataUtilTest method isInline.
@Test
public void isInline() {
KeyData keyData = new KeyData();
keyData.setPublicKey("PUBLICKEY");
keyData.setConfig(mock(KeyDataConfig.class));
assertThat(KeyDataUtil.isInline(keyData)).isTrue();
}
use of com.quorum.tessera.config.KeyData in project tessera by ConsenSys.
the class KeyDataUtilTest method unmarshalFilesystemKeyPair.
@Test
public void unmarshalFilesystemKeyPair() {
KeyEncryptor keyEncryptor = mock(KeyEncryptor.class);
KeyData keyData = new KeyData();
Path privateKeyPath = mock(Path.class);
Path publicKeyPath = mock(Path.class);
keyData.setPrivateKeyPath(privateKeyPath);
keyData.setPublicKeyPath(publicKeyPath);
FilesystemKeyPair result = (FilesystemKeyPair) KeyDataUtil.unmarshal(keyData, keyEncryptor);
assertThat(result).isNotNull();
assertThat(result.getPrivateKeyPath()).isSameAs(privateKeyPath);
assertThat(result.getPublicKeyPath()).isSameAs(publicKeyPath);
verifyZeroInteractions(keyEncryptor);
}
use of com.quorum.tessera.config.KeyData in project tessera by ConsenSys.
the class KeyDataUtilTest method isFilesystem.
@Test
public void isFilesystem() {
KeyData keyData = new KeyData();
keyData.setPublicKeyPath(mock(Path.class));
keyData.setPrivateKeyPath(mock(Path.class));
assertThat(KeyDataUtil.isFileSystem(keyData)).isTrue();
}
use of com.quorum.tessera.config.KeyData in project tessera by ConsenSys.
the class KeyDataUtilTest method getKeyPairTypeForAwsVaultKeyPair.
@Test
public void getKeyPairTypeForAwsVaultKeyPair() {
KeyData keyData = new KeyData();
keyData.setAwsSecretsManagerPrivateKeyId("AWS_PRIVATE_KEY");
keyData.setAwsSecretsManagerPublicKeyId("AWS_PUBLIC_KEY");
Class<? extends ConfigKeyPair> result = KeyDataUtil.getKeyPairTypeFor(keyData);
assertThat(result).isEqualTo(AWSKeyPair.class);
}
use of com.quorum.tessera.config.KeyData in project tessera by ConsenSys.
the class KeyDataUtilTest method isHashicorp.
@Test
public void isHashicorp() {
KeyData keyData = new KeyData();
keyData.setHashicorpVaultPublicKeyId("HashicorpVaultPublicKeyId");
keyData.setHashicorpVaultPrivateKeyId("HashicorpVaultPrivateKeyId");
keyData.setHashicorpVaultSecretName("HashicorpVaultSecretName");
keyData.setHashicorpVaultSecretEngineName("HashicorpVaultSecretEngineName");
assertThat(KeyDataUtil.isHashicorp(keyData)).isTrue();
}
Aggregations