Class JWECryptoParts


  • @Immutable
    public final class JWECryptoParts
    extends Object
    The cryptographic parts of a JSON Web Encryption (JWE) object.
    Version:
    2021-09-30
    Author:
    Vladimir Dzhuvinov
    • Constructor Detail

      • JWECryptoParts

        public JWECryptoParts​(Base64URL encryptedKey,
                              Base64URL iv,
                              Base64URL cipherText,
                              Base64URL authenticationTag)
        Creates a new cryptographic JWE parts instance.
        Parameters:
        encryptedKey - The encrypted key, null if not required by the encryption algorithm.
        iv - The initialisation vector (IV), null if not required by the encryption algorithm.
        cipherText - The cipher text. Must not be null.
        authenticationTag - The authentication tag, null if the JWE algorithm provides built-in integrity check.
      • JWECryptoParts

        public JWECryptoParts​(JWEHeader header,
                              Base64URL encryptedKey,
                              Base64URL iv,
                              Base64URL cipherText,
                              Base64URL authenticationTag)
        Creates a new cryptographic JWE parts instance.
        Parameters:
        header - The modified JWE header, null if not.
        encryptedKey - The encrypted key, null if not required by the encryption algorithm.
        iv - The initialisation vector (IV), null if not required by the encryption algorithm.
        cipherText - The cipher text. Must not be null.
        authenticationTag - The authentication tag, null if the JWE algorithm provides built-in integrity check.
    • Method Detail

      • getHeader

        public JWEHeader getHeader()
        Gets the modified JWE header.
        Returns:
        The modified JWE header, null of not.
      • getEncryptedKey

        public Base64URL getEncryptedKey()
        Gets the encrypted key.
        Returns:
        The encrypted key, null if not required by the JWE algorithm or recipients are specified.
      • getInitializationVector

        public Base64URL getInitializationVector()
        Gets the initialisation vector (IV).
        Returns:
        The initialisation vector (IV), null if not required by the JWE algorithm.
      • getAuthenticationTag

        public Base64URL getAuthenticationTag()
        Gets the authentication tag.
        Returns:
        The authentication tag, null if the encryption algorithm provides built-in integrity checking.