public final class JwtHmacKeyManager extends KeyTypeManager<JwtHmacKey>
JwtHmacKey keys and produces new instances of JwtHmac.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Constructor and Description |
|---|
JwtHmacKeyManager() |
| Modifier and Type | Method and Description |
|---|---|
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
int |
getVersion()
Returns the version number of this KeyManager.
|
static KeyTemplate |
hs256Template()
Returns a
KeyTemplate that generates new instances of HS256 256-bit keys. |
static KeyTemplate |
hs384Template()
Returns a
KeyTemplate that generates new instances of HS384 384-bit keys. |
static KeyTemplate |
hs512Template()
Returns a
KeyTemplate that generates new instances of HS512 384-bit keys. |
KeyTypeManager.KeyFactory<JwtHmacKeyFormat,JwtHmacKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
JwtHmacKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static void |
register(boolean newKeyAllowed) |
void |
validateKey(JwtHmacKey key)
Checks if the given
keyProto is a valid key. |
fipsStatus, firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<JwtHmacKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<JwtHmacKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<JwtHmacKey>public void validateKey(JwtHmacKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<JwtHmacKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public JwtHmacKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<JwtHmacKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<JwtHmacKeyFormat,JwtHmacKey> keyFactory()
KeyTypeManagerKeyTypeManager.KeyFactory for this key type.
By default, this throws an UnsupportedOperationException. Hence, if an implementation does not support creating primitives, no implementation is required.
keyFactory in class KeyTypeManager<JwtHmacKey>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static final KeyTemplate hs256Template()
KeyTemplate that generates new instances of HS256 256-bit keys.public static final KeyTemplate hs384Template()
KeyTemplate that generates new instances of HS384 384-bit keys.public static final KeyTemplate hs512Template()
KeyTemplate that generates new instances of HS512 384-bit keys.