use of org.cloudfoundry.credhub.credential.SshCredentialValue in project credhub by cloudfoundry-incubator.
the class SshGeneratorTest method generateCredential_shouldReturnAGeneratedCredential.
@Test
public void generateCredential_shouldReturnAGeneratedCredential() throws Exception {
final SshCredentialValue ssh = subject.generateCredential(new SshGenerationParameters());
verify(keyPairGeneratorMock).generateKeyPair(2048);
assertThat(ssh.getPublicKey(), equalTo(CertificateFormatter.derOf((RSAPublicKey) keyPair.getPublic())));
assertThat(ssh.getPrivateKey(), equalTo(CertificateFormatter.pemOf(keyPair.getPrivate())));
}
Aggregations