public class KmsTemplate extends Object implements KmsOperations
| Constructor and Description |
|---|
KmsTemplate(KeyManagementServiceClient keyManagementServiceClient,
GcpProjectIdProvider projectIdProvider) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decryptBytes(String cryptoKey,
byte[] cipherText)
Decrypt the text using the specified KMS resource string
cryptoKey |
String |
decryptText(String cryptoKey,
byte[] cipherText)
Decrypt the text using the specified KMS resource string
cryptoKey |
byte[] |
encryptBytes(String cryptoKey,
byte[] bytes)
Encrypt the
bytes using the specified KMS resource string cryptoKey. |
byte[] |
encryptText(String cryptoKey,
String text)
Encrypt the
text using the specified KMS resource string cryptoKey. |
public KmsTemplate(KeyManagementServiceClient keyManagementServiceClient, GcpProjectIdProvider projectIdProvider)
public byte[] encryptText(String cryptoKey, String text)
KmsOperationstext using the specified KMS resource string cryptoKey.
An encryption request will be issued using GCP KMS.
encryptText in interface KmsOperationscryptoKey - The KMS resource stringtext - UTF-8 encoded text to encryptpublic byte[] encryptBytes(String cryptoKey, byte[] bytes)
KmsOperationsbytes using the specified KMS resource string cryptoKey.
An encryption request will be issued using GCP KMS.
encryptBytes in interface KmsOperationscryptoKey - The KMS resource stringbytes - The bytes to encryptpublic String decryptText(String cryptoKey, byte[] cipherText)
KmsOperationscryptoKey
A decryption request will be issued using GCP KMS.
decryptText in interface KmsOperationscryptoKey - The KMS resource stringcipherText - The encrypted bytespublic byte[] decryptBytes(String cryptoKey, byte[] cipherText)
KmsOperationscryptoKey
A decryption request will be issued using GCP KMS.
decryptBytes in interface KmsOperationscryptoKey - The KMS resource stringcipherText - The encrypted bytesCopyright © 2021. All rights reserved.