co.com.bancolombia.datamask.aws.cipher.AWSEncryptionSdkCipher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of data-mask-aws Show documentation
Show all versions of data-mask-aws Show documentation
Data Masking library for jackson-databind.
The newest version!
package co.com.bancolombia.datamask.aws.cipher;
import co.com.bancolombia.datamask.cipher.DataCipher;
import com.amazonaws.encryptionsdk.AwsCrypto;
import com.amazonaws.encryptionsdk.jce.JceMasterKey;
import lombok.RequiredArgsConstructor;
import java.util.Base64;
@RequiredArgsConstructor
public class AWSEncryptionSdkCipher implements DataCipher {
private final AwsCrypto awsCrypto;
private final JceMasterKey masterKeyProvider;
@Override
public String cipher(String inputData) {
var cipherText = awsCrypto.encryptData(masterKeyProvider, inputData.getBytes()).getResult();
return new String(Base64.getEncoder().encode(cipherText));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy