Class AAD

java.lang.Object
com.nimbusds.jose.crypto.impl.AAD

public class AAD extends Object
Additional authenticated data (AAD).

See RFC 7518 (JWA), section 5.1, point 14.

Version:
2017-06-01
Author:
Vladimir Dzhuvinov
  • Constructor Summary

    Constructors
    Constructor
    Description
    AAD()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    compute(JWEHeader jweHeader)
    Computes the Additional Authenticated Data (AAD) for the specified JWE header.
    static byte[]
    compute(Base64URL encodedJWEHeader)
    Computes the Additional Authenticated Data (AAD) for the specified BASE64URL-encoded JWE header.
    static byte[]
    computeLength(byte[] aad)
    Computes the bit length of the specified Additional Authenticated Data (AAD).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AAD

      public AAD()
  • Method Details

    • compute

      public static byte[] compute(JWEHeader jweHeader)
      Computes the Additional Authenticated Data (AAD) for the specified JWE header.
      Parameters:
      jweHeader - The JWE header. Must not be null.
      Returns:
      The AAD.
    • compute

      public static byte[] compute(Base64URL encodedJWEHeader)
      Computes the Additional Authenticated Data (AAD) for the specified BASE64URL-encoded JWE header.
      Parameters:
      encodedJWEHeader - The BASE64URL-encoded JWE header. Must not be null.
      Returns:
      The AAD.
    • computeLength

      public static byte[] computeLength(byte[] aad) throws IntegerOverflowException
      Computes the bit length of the specified Additional Authenticated Data (AAD). Used in AES/CBC/PKCS5Padding/HMAC-SHA2 encryption.
      Parameters:
      aad - The Additional Authenticated Data (AAD). Must not be null.
      Returns:
      The computed AAD bit length, as a 64 bit big-endian representation (8 byte array).
      Throws:
      IntegerOverflowException - On a integer overflow.