void validateSignatureAlgorithmWithKey ( JwtConsumerConfig config , Key key ) throws InvalidClaimException { String signatureAlgorithm = config . getSignatureAlgorithm ( ) ; if ( key == null && signatureAlgorithm != null && ! signatureAlgorithm . equalsIgnoreCase ( "none" ) ) { String msg = Tr . formatMessage ( tc , "JWT_MISSING_KEY" , new Object [ ] { signatureAlgorithm } ) ; throw new InvalidClaimException ( msg ) ; } }
Throws an exception if the provided key is null but the config specifies a signature algorithm other than none .