Package com.nimbusds.jose.crypto.impl
Class CompositeKey
java.lang.Object
com.nimbusds.jose.crypto.impl.CompositeKey
Composite key used in AES/CBC/PKCS5Padding/HMAC-SHA2 encryption. This class
is immutable.
See RFC 7518 (JWA), section 5.2.
See draft-mcgrew-aead-aes-cbc-hmac-sha2-01
- Version:
- 2015-06-29
- Author:
- Vladimir Dzhuvinov
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeKey
(SecretKey inputKey) Creates a new composite key from the specified secret key. -
Method Summary
Modifier and TypeMethodDescriptionGets the extracted encryption key.Gets the input key.Gets the extracted MAC key.int
Gets the expected truncated MAC length.
-
Constructor Details
-
CompositeKey
Creates a new composite key from the specified secret key.- Parameters:
inputKey
- The input key. Must be 256, 384 or 512 bits long. Must not benull
.- Throws:
KeyLengthException
- If the input key length is not supported.
-
-
Method Details
-
getInputKey
Gets the input key.- Returns:
- The input key.
-
getMACKey
Gets the extracted MAC key.- Returns:
- The extracted MAC key.
-
getTruncatedMACByteLength
Gets the expected truncated MAC length.- Returns:
- The expected truncated MAC length, in bytes.
-
getAESKey
Gets the extracted encryption key.- Returns:
- The extracted encryption key.
-