use of org.cloudfoundry.credhub.service.PasswordBasedKeyProxy in project credhub by cloudfoundry-incubator.
the class EncryptionKeyRotatorTest method createOldKey.
private Key createOldKey() throws Exception {
final PasswordBasedKeyProxy keyProxy = new PasswordBasedKeyProxy("old-password", 1, encryptionService);
Key oldKey = keyProxy.deriveKey();
oldCanary = new EncryptionKeyCanary();
final EncryptedValue canaryEncryption = encryptionService.encrypt(null, oldKey, CANARY_VALUE);
oldCanary.setEncryptedCanaryValue(canaryEncryption.getEncryptedValue());
oldCanary.setNonce(canaryEncryption.getNonce());
oldCanary = encryptionKeyCanaryDataService.save(oldCanary);
keySet.add(new EncryptionKey(encryptionService, oldCanary.getUuid(), oldKey));
return oldKey;
}
Aggregations