Top Fields Constructors Methods
org.keycloak.crypto

public Class PublicKeysWrapper

extends Object
Class Inheritance
Imports
java.util.Collections, .List, .Objects, java.util.function.Predicate, java.util.stream.Collectors, .Stream

Author
Marek Posolda

Field Summary

Modifier and TypeField and Description
public static final PublicKeysWrapper
private final List<KeyWrapper>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public KeyWrapper

Returns:

KeyWrapper matching given parameters
getKeyByKidAndAlg
(String
rfc7517 KID parameter
kid
,
String
rfc7517 alg parameter
alg
)

Find an appropriate key given a KID and algorithm.

public KeyWrapper

Returns:

The first key that matches the predicate or null
getKeyByPredicate
(Predicate<KeyWrapper>
The predicate
predicate
)

Returns the first key that matches the predicate.

public List<KeyWrapper>
public List<String>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
public static final PublicKeysWrapper EMPTY
keysback to summary
private final List<KeyWrapper> keys

Constructor Detail

PublicKeysWrapperback to summary
public PublicKeysWrapper(List<KeyWrapper> keys)

Method Detail

getKeyByKidAndAlgback to summary
public KeyWrapper getKeyByKidAndAlg(String kid, String alg)

Find an appropriate key given a KID and algorithm. Prefer matching on both parameters, but may partially match on KID only. Or if KID is not provided, the algorithm. Will use a flagged default client certificate otherwise, if a match is not found.

Parameters
kid:String

rfc7517 KID parameter

alg:String

rfc7517 alg parameter

Returns:KeyWrapper

KeyWrapper matching given parameters

getKeyByPredicateback to summary
public KeyWrapper getKeyByPredicate(Predicate<KeyWrapper> predicate)

Returns the first key that matches the predicate.

Parameters
predicate:Predicate<KeyWrapper>

The predicate

Returns:KeyWrapper

The first key that matches the predicate or null

getKeysback to summary
public List<KeyWrapper> getKeys()
getKidsback to summary
public List<String> getKids()