Package com.google.crypto.tink.jwt
Class JwtHmacParameters.KidStrategy
- java.lang.Object
-
- com.google.crypto.tink.jwt.JwtHmacParameters.KidStrategy
-
- Enclosing class:
- JwtHmacParameters
@Immutable public static final class JwtHmacParameters.KidStrategy extends java.lang.ObjectSpecifies how the "kid" header is handled.
-
-
Field Summary
Fields Modifier and Type Field Description static JwtHmacParameters.KidStrategyBASE64_ENCODED_KEY_IDThe "kid" is the URL safe (RFC 4648 Section 5) base64-encoded big-endian key_id in the keyset.static JwtHmacParameters.KidStrategyCUSTOMThe "kid" is fixed.static JwtHmacParameters.KidStrategyIGNOREDThe "kid" header is ignored.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString()
-
-
-
Field Detail
-
BASE64_ENCODED_KEY_ID
public static final 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.In
computeMacAndEncodeTink always adds the KID.In
verifyMacAndDecodeTink checks that the kid is present and equal to this value.This strategy is recommended by Tink.
-
IGNORED
public static final JwtHmacParameters.KidStrategy IGNORED
The "kid" header is ignored.In
computeMacAndEncodeTink does not write a "kid" header.In
verifyMacAndDecodeTink ignores the "kid" header.
-
CUSTOM
public static final JwtHmacParameters.KidStrategy CUSTOM
The "kid" is fixed. It can be obtained fromparameters.getCustomKid().In
computeMacAndEncodeTink writes the "kid" header to the value given byparameters.getCustomKid().In
verifyMacAndDecodeIf the kid is present, it needs to matchparameters.getCustomKid(). If the kid is absent, it will be accepted.Note: Tink does not allow to randomly generate new
JwtHmacKeyobjects from parameters objects withKidStrategyequals toCUSTOM.
-
-