use of org.cloudfoundry.credhub.entity.CertificateCredentialVersionData in project credhub by cloudfoundry-incubator.
the class CertificateCredentialVersionTest method setup.
@Before
public void setup() {
TestHelper.getBouncyCastleProvider();
encryptor = mock(Encryptor.class);
encryptedValue = "fake-encrypted-value".getBytes();
nonce = "fake-nonce".getBytes();
canaryUuid = UUID.randomUUID();
final EncryptedValue encryption = new EncryptedValue(canaryUuid, encryptedValue, nonce);
when(encryptor.encrypt("my-priv")).thenReturn(encryption);
when(encryptor.decrypt(encryption)).thenReturn("my-priv");
certificateCredentialData = new CertificateCredentialVersionData("/Foo");
subject = new CertificateCredentialVersion(certificateCredentialData).setEncryptor(encryptor).setCa("my-ca").setCertificate("my-cert").setPrivateKey("my-priv");
}
Aggregations