Class GoogleKmsKey

    • Method Detail

      • getFormat

        public String getFormat()
        The format is set to null to match the result for a non-extractable PKCS#11 key.
        Specified by:
        getFormat in interface Key
        Returns:
        null.
      • 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.