use of org.cloudfoundry.credhub.entity.SshCredentialVersionData in project credhub by cloudfoundry-incubator.
the class CredentialRotationTest method rotate_givenSshCredential_reEncryptsWithActiveKey.
@Test
public void rotate_givenSshCredential_reEncryptsWithActiveKey() {
SshCredentialVersionData sshCredentialData = new SshCredentialVersionData("ssh-key");
SshCredentialVersion credential = new SshCredentialVersion(sshCredentialData);
assertRotation(credential, sshCredentialData);
}
use of org.cloudfoundry.credhub.entity.SshCredentialVersionData in project credhub by cloudfoundry-incubator.
the class CredentialVersionDataServiceTest method save_whenTheCredentialSavedWithoutEncryptedValueSet_doesNotSetTheMasterEncryptionKeyUuid.
@Test
public void save_whenTheCredentialSavedWithoutEncryptedValueSet_doesNotSetTheMasterEncryptionKeyUuid() {
SshCredentialVersionData sshCredentialData = new SshCredentialVersionData("/my-credential");
SshCredentialVersion credential = new SshCredentialVersion(sshCredentialData).setEncryptor(encryptor).setPublicKey("fake-public-key");
subject.save(credential);
assertThat(sshCredentialData.getEncryptionKeyUuid(), nullValue());
}
use of org.cloudfoundry.credhub.entity.SshCredentialVersionData in project credhub by cloudfoundry-incubator.
the class CredentialVersionDataServiceTest method save_whenTheCredentialSavedWithEncryptedValueSet_setsTheMasterEncryptionKeyUuid.
@Test
public void save_whenTheCredentialSavedWithEncryptedValueSet_setsTheMasterEncryptionKeyUuid() {
SshCredentialVersionData sshCredentialData = new SshCredentialVersionData("/my-credential");
SshCredentialVersion credential = new SshCredentialVersion(sshCredentialData).setEncryptor(encryptor).setPrivateKey("private-key").setPublicKey("fake-public-key");
subject.save(credential);
assertThat(sshCredentialData.getEncryptionKeyUuid(), equalTo(activeCanaryUuid));
}
use of org.cloudfoundry.credhub.entity.SshCredentialVersionData in project credhub by cloudfoundry-incubator.
the class SshCredentialVersionTest method setUp.
@Before
public void setUp() {
sshPublicKeyParser = mock(SshPublicKeyParser.class);
SshCredentialVersionData credentialVersionData = mock(SshCredentialVersionData.class);
subject = new SshCredentialVersion(credentialVersionData, sshPublicKeyParser);
}
Aggregations