public class KmsTextEncryptor extends Object implements org.springframework.security.crypto.encrypt.TextEncryptor
TextEncryptor uses AWS KMS (Key Management Service) to encrypt / decrypt strings. Encoded cipher strings
are represented in Base64 format, to have a nicer string representation (only alpha-numeric chars), that can be
easily used as values in property files.| Constructor and Description |
|---|
KmsTextEncryptor(com.amazonaws.services.kms.AWSKMS kms,
String kmsKeyId) |
| Modifier and Type | Method and Description |
|---|---|
String |
decrypt(String encryptedText) |
String |
encrypt(String text) |
public KmsTextEncryptor(com.amazonaws.services.kms.AWSKMS kms,
String kmsKeyId)
kms - The AWS KMS clientkmsKeyId - The ARN of the KMS key, e.g.
arn:aws:kms:eu-west-1:089972051332:key/9d9fca31-54c5-4de5-ba4f-128dfb9a5031. Must not be blank,
if you you want to encrypt text.Copyright © 2015 Zalando SE. All rights reserved.