public interface KmsOperations
For the methods you need specify the secret from GCP KMS by resource string.
The following secret resource syntax is supported:
1. Shortest form - specify the key by key ring ID, and key ID.
Project is derived through GcpProjectIdProvider
. The location is assumed to be `global`.
{key-ring-id}/{key-id}
2. Short form - specify location ID, key ring ID, and key ID. Project is derived through GcpProjectIdProvider
.
{location-id}/{key-ring-id}/{key-id}
3. Full form - specify project ID, location ID, key ring ID, and key ID
{project-id}/{location-id}/{key-ring-id}/{key-id}
4. Long form - specify project ID, location ID, key ring ID, and key ID (full resource name)
projects/{project-id}/locations/{location-id}/keyRings/{key-ring-id}/cryptoKeys/{key-id}
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 . |
byte[] encryptText(String cryptoKey, String text)
text
using the specified KMS resource string cryptoKey
.
An encryption request will be issued using GCP KMS.
cryptoKey
- The KMS resource stringtext
- UTF-8 encoded text to encryptbyte[] encryptBytes(String cryptoKey, byte[] bytes)
bytes
using the specified KMS resource string cryptoKey
.
An encryption request will be issued using GCP KMS.
cryptoKey
- The KMS resource stringbytes
- The bytes to encryptbyte[] decryptBytes(String cryptoKey, byte[] cipherText)
cryptoKey
A decryption request will be issued using GCP KMS.
cryptoKey
- The KMS resource stringcipherText
- The encrypted bytesString decryptText(String cryptoKey, byte[] cipherText)
cryptoKey
A decryption request will be issued using GCP KMS.
cryptoKey
- The KMS resource stringcipherText
- The encrypted bytesCopyright © 2021. All rights reserved.