Class JWSVerificationKeySelector<C extends SecurityContext>

    • Constructor Detail

      • JWSVerificationKeySelector

        public JWSVerificationKeySelector​(JWSAlgorithm jwsAlg,
                                          JWKSource<C> jwkSource)
        Creates a new JWS verification key selector.
        Parameters:
        jwsAlg - The allowed JWS algorithm for the objects to be verified. Must not be null.
        jwkSource - The JWK source. Must not be null.
      • JWSVerificationKeySelector

        public JWSVerificationKeySelector​(Set<JWSAlgorithm> jwsAlgs,
                                          JWKSource<C> jwkSource)
        Creates a new JWS verification key selector.
        Parameters:
        jwsAlgs - The allowed JWS algorithms for the objects to be verified. Must not be empty or null.
        jwkSource - The JWK source. Must not be null.
    • Method Detail

      • isAllowed

        public boolean isAllowed​(JWSAlgorithm jwsAlg)
        Checks if a JWS algorithm is allowed for key selection.
        Parameters:
        jwsAlg - The JWS algorithm to check.
        Returns:
        true if allowed, else false.
      • createJWKMatcher

        protected JWKMatcher createJWKMatcher​(JWSHeader jwsHeader)
        Creates a JWK matcher for the expected JWS algorithm and the specified JWS header.
        Parameters:
        jwsHeader - The JWS header. Must not be null.
        Returns:
        The JWK matcher, null if none could be created.
      • getJWKSource

        public JWKSource<C> getJWKSource()
        Returns the JWK source.
        Returns:
        The JWK source.