Package org.forgerock.secrets.gcpkms
Class GoogleKmsKey
java.lang.Object
org.forgerock.secrets.gcpkms.GoogleKmsKey
- All Implemented Interfaces:
Serializable
,Key
- Direct Known Subclasses:
GoogleKmsPrivateKey
,GoogleKmsSecretKey
Abstract base class for keys stored in Google KMS.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] ciphertext) Decrypts the given ciphertext using this key.byte[]
decryptWithAssociatedData
(byte[] ciphertext, byte[] associatedData) Decrypts the given ciphertext using this key.byte[]
Not supported.The format is set tonull
to match the result for a non-extractable PKCS#11 key.
-
Method Details
-
getFormat
The format is set tonull
to match the result for a non-extractable PKCS#11 key. -
decrypt
public byte[] decrypt(byte[] ciphertext) Decrypts the given ciphertext using this key.- Parameters:
ciphertext
- the ciphertext to decrypt.- Returns:
- the decrypted plaintext.
- Throws:
UnsupportedOperationException
- if this key is not a decryption key.
-
decryptWithAssociatedData
public byte[] decryptWithAssociatedData(byte[] ciphertext, byte[] associatedData) Decrypts the given ciphertext using this key. The given associated data will be included in the authentication tag calculation. This must be identical to the associated data that was provided in the encryption operation. Associated data is only supported for symmetric decryption.- Parameters:
ciphertext
- the ciphertext to decrypt.associatedData
- the associated data to include in the authentication tag.- Returns:
- the decrypted plaintext.
- Throws:
UnsupportedOperationException
- if this key is not a decryption key.
-
getEncoded
public byte[] getEncoded()Not supported.- Specified by:
getEncoded
in interfaceKey
- Throws:
UnsupportedOperationException
- as this is not supported for KMS keys.
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
-