use of io.cdap.cdap.securestore.spi.secret.SecretMetadata in project cdap by caskdata.
the class CloudSecretManager method store.
@Override
public void store(String namespace, Secret secret) throws IOException {
// creates new crypto key for every namespace
client.createCryptoKeyIfNotExists(CRYPTO_KEY_PREFIX + namespace);
byte[] encryptedData = client.encrypt(CRYPTO_KEY_PREFIX + namespace, secret.getData());
SecretMetadata metadata = secret.getMetadata();
SecretInfo secretInfo = new SecretInfo(metadata.getName(), metadata.getDescription(), encryptedData, metadata.getCreationTimeMs(), metadata.getProperties());
store.store(namespace, metadata.getName(), encoderDecoder, secretInfo);
}
Aggregations