@ThreadSafe public class JWSVerificationKeySelector<C extends SecurityContext> extends Object implements JWSKeySelector<C>
JSON Web Key (JWK) source
.Constructor and Description |
---|
JWSVerificationKeySelector(JWSAlgorithm jwsAlg,
JWKSource<C> jwkSource)
Creates a new JWS verification key selector.
|
Modifier and Type | Method and Description |
---|---|
protected JWKMatcher |
createJWKMatcher(JWSHeader jwsHeader)
Creates a JWK matcher for the expected JWS algorithm and the
specified JWS header.
|
JWSAlgorithm |
getExpectedJWSAlgorithm()
Returns the expected JWS algorithm.
|
JWKSource<C> |
getJWKSource()
Returns the JWK source.
|
List<Key> |
selectJWSKeys(JWSHeader jwsHeader,
C context)
Selects key candidates for verifying a JWS object.
|
public JWSVerificationKeySelector(JWSAlgorithm jwsAlg, JWKSource<C> jwkSource)
jwsAlg
- The expected JWS algorithm for the objects to be
verified. Must not be null
.jwkSource
- The JWK source. Must not be null
.public JWSAlgorithm getExpectedJWSAlgorithm()
protected JWKMatcher createJWKMatcher(JWSHeader jwsHeader)
jwsHeader
- The JWS header. Must not be null
.null
if none could be created.public List<Key> selectJWSKeys(JWSHeader jwsHeader, C context) throws KeySourceException
JWSKeySelector
selectJWSKeys
in interface JWSKeySelector<C extends SecurityContext>
jwsHeader
- The header of the JWS object. Must not be
null
.context
- Optional context of the JWS object, null
if
not required.KeySourceException
- If a key sourcing exception is
encountered, e.g. on remote JWK
retrieval.public JWKSource<C> getJWKSource()
Copyright © 2017 Connect2id Ltd.. All rights reserved.