Package com.nimbusds.jose.crypto.impl
Class AAD
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.AAD
-
-
Constructor Summary
Constructors Constructor Description AAD()
-
Method Summary
All Methods Static Methods Concrete Methods 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).
-
-
-
Constructor Detail
-
AAD
public AAD()
-
-
Method Detail
-
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 benull
.- 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 benull
.- 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 benull
.- Returns:
- The computed AAD bit length, as a 64 bit big-endian representation (8 byte array).
- Throws:
IntegerOverflowException
- On a integer overflow.
-
-