@Immutable public static final class JwtHmacParameters.KidStrategy extends Object
| Modifier and Type | Field and Description |
|---|---|
static JwtHmacParameters.KidStrategy |
BASE64_ENCODED_KEY_ID
The "kid" is the URL safe (RFC 4648 Section 5) base64-encoded big-endian key_id in the
keyset.
|
static JwtHmacParameters.KidStrategy |
CUSTOM
The "kid" is fixed.
|
static JwtHmacParameters.KidStrategy |
IGNORED
The "kid" header is ignored.
|
public static final JwtHmacParameters.KidStrategy BASE64_ENCODED_KEY_ID
In computeMacAndEncode Tink always adds the KID.
In verifyMacAndDecode Tink checks that the kid is present and equal to this value.
This strategy is recommended by Tink.
public static final JwtHmacParameters.KidStrategy IGNORED
In computeMacAndEncode Tink does not write a "kid" header.
In verifyMacAndDecode Tink ignores the "kid" header.
public static final JwtHmacParameters.KidStrategy CUSTOM
parameters.getCustomKid().
In computeMacAndEncode Tink writes the "kid" header to the value given by parameters.getCustomKid().
In verifyMacAndDecode If the kid is present, it needs to match parameters.getCustomKid(). If the kid is absent, it will be accepted.
Note: Tink does not allow to randomly generate new JwtHmacKey objects from
parameters objects with KidStrategy equals to CUSTOM.