Package edu.uiuc.ncsa.security.util.jwk
Class JSONWebKeys
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,JSONWebKey>
-
- edu.uiuc.ncsa.security.util.jwk.JSONWebKeys
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,JSONWebKey>
public class JSONWebKeys extends HashMap<String,JSONWebKey> implements Serializable
A collection ofJSONWebKey
objects. This also allows specifying an identifier as the default to be used for all signing.Created by Jeff Gaynor
on 1/9/17 at 10:37 AM- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description JSONWebKeys(String defaultKeyID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSONWebKey
getDefault()
String
getDefaultKeyID()
Get the default key id for this set.boolean
hasDefaultKey()
test if a default key id has been set for this set.void
put(JSONWebKey webKey)
Add a key to this set.void
setDefaultKeyID(String defaultKeyID)
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
JSONWebKeys
public JSONWebKeys(String defaultKeyID)
-
-
Method Detail
-
getDefault
public JSONWebKey getDefault()
-
hasDefaultKey
public boolean hasDefaultKey()
test if a default key id has been set for this set.- Returns:
-
getDefaultKeyID
public String getDefaultKeyID()
Get the default key id for this set.- Returns:
-
setDefaultKeyID
public void setDefaultKeyID(String defaultKeyID)
-
put
public void put(JSONWebKey webKey)
Add a key to this set. Since the hash is on the identifier, the key is checked for having one before being added and adding a key will fail if there is no identifier set.- Parameters:
webKey
-
-
-