Class EncryptResult


  • public final class EncryptResult
    extends Object
    Represents the details of encrypt operation result.
    • Constructor Detail

      • EncryptResult

        public EncryptResult​(byte[] ciphertext,
                             EncryptionAlgorithm algorithm,
                             String keyId)
        Creates the instance of Encrypt Result holding encryption operation response information.
        Parameters:
        ciphertext - The encrypted content.
        algorithm - The algorithm used to encrypt the content.
        keyId - The identifier of the key usd for the encryption operation.
      • EncryptResult

        public EncryptResult​(byte[] ciphertext,
                             EncryptionAlgorithm algorithm,
                             String keyId,
                             byte[] iv,
                             byte[] authenticationTag,
                             byte[] additionalAuthenticatedData)
        Creates the instance of Encrypt Result holding encryption operation response information.
        Parameters:
        ciphertext - The encrypted content.
        algorithm - The algorithm used to encrypt the content.
        keyId - The identifier of the key usd for the encryption operation.
        iv - Initialization vector for symmetric algorithms.
        authenticationTag - The tag to authenticate when performing decryption with an authenticated algorithm.
        additionalAuthenticatedData - Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms.
    • Method Detail

      • getKeyId

        public String getKeyId()
        Get the identifier of the key used to do encryption
        Returns:
        the key identifier
      • getCipherText

        public byte[] getCipherText()
        Get the encrypted content.
        Returns:
        The encrypted content.
      • getAlgorithm

        public EncryptionAlgorithm getAlgorithm()
        Get the encryption algorithm used for encryption.
        Returns:
        The encryption algorithm used.
      • getIv

        public byte[] getIv()
        Get the initialization vector used by symmetric algorithms.
        Returns:
        The initialization vector.
      • getAuthenticationTag

        public byte[] getAuthenticationTag()
        Get the tag to authenticate the encrypted content.
        Returns:
        The authentication tag.
      • getAdditionalAuthenticatedData

        public byte[] getAdditionalAuthenticatedData()
        Get additional data to authenticate the encrypted content.
        Returns:
        The additional authenticated data.