Package io.smallrye.jwt.auth.principal
Class AbstractKeyLocationResolver
java.lang.Object
io.smallrye.jwt.auth.principal.AbstractKeyLocationResolver
- Direct Known Subclasses:
DecryptionKeyLocationResolver,KeyLocationResolver,X509KeyLocationResolver
This implements the MP-JWT 1.1 mp.jwt.verify.publickey.location config property resolution logic
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JWTAuthContextInfoprotected Objectprotected org.jose4j.jwk.HttpsJwksprotected List<org.jose4j.jwk.JsonWebKey> protected Keyprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected org.jose4j.http.Getprotected org.jose4j.jwk.JsonWebKeygetHttpsJwk(String kid, String algo) protected org.jose4j.jwk.HttpsJwksgetHttpsJwks(String location) protected org.jose4j.jwk.JsonWebKeygetJsonWebKey(String kid, String algo) protected static org.jose4j.jwk.JsonWebKeygetJsonWebKey(String kid, List<org.jose4j.jwk.JsonWebKey> keys, String algo) protected static StringgetKid(org.jose4j.jwx.JsonWebStructure jws) protected KeygetSecretKeyFromJwk(org.jose4j.jwk.JsonWebKey jwk) protected ResourceUtils.UrlStreamResolverprotected org.jose4j.jwk.HttpsJwksinitializeHttpsJwks(String location) protected booleanisHttpsJwksInitialized(String keyLocation) protected static booleanisMatchingJwkAvailable(List<org.jose4j.jwk.JsonWebKey> keys, String kid) protected org.jose4j.jwk.JsonWebKeyloadFromJwk(String content, String keyId, String algo) protected voidloadJWKContent(String content) protected static X509CertificateloadPEMCertificate(String content) protected StringreadKeyContent(String keyLocation) protected static voidreportLoadKeyException(String keyContent, String keyLocation, Exception e) protected static voidreportUnresolvableKeyException(String keyContent, String keyLocation) protected org.jose4j.jwk.JsonWebKeyprotected org.jose4j.jwk.JsonWebKeytryJWKContent(String content, String keyId, String algo, boolean encoded) protected static void
-
Field Details
-
key
-
jsonWebKeys
-
httpsJwks
protected org.jose4j.jwk.HttpsJwks httpsJwks -
lastForcedRefreshTime
protected long lastForcedRefreshTime -
forcedRefreshLock
-
authContextInfo
-
-
Constructor Details
-
AbstractKeyLocationResolver
public AbstractKeyLocationResolver(JWTAuthContextInfo authContextInfo) throws org.jose4j.lang.UnresolvableKeyException - Throws:
org.jose4j.lang.UnresolvableKeyException
-
-
Method Details
-
isMatchingJwkAvailable
-
verifyKid
protected static void verifyKid(org.jose4j.jwx.JsonWebStructure jws, String expectedKid) throws org.jose4j.lang.UnresolvableKeyException - Throws:
org.jose4j.lang.UnresolvableKeyException
-
getKid
-
initializeHttpsJwks
- Throws:
IOException
-
getHttpsJwks
-
getHttpGet
protected org.jose4j.http.Get getHttpGet() -
isHttpsJwksInitialized
- Throws:
IOException
-
forcedHttpsJwksRefresh
protected boolean forcedHttpsJwksRefresh() -
readKeyContent
- Throws:
IOException
-
getUrlResolver
-
getJsonWebKey
-
reportLoadKeyException
protected static void reportLoadKeyException(String keyContent, String keyLocation, Exception e) throws org.jose4j.lang.UnresolvableKeyException - Throws:
org.jose4j.lang.UnresolvableKeyException
-
reportUnresolvableKeyException
protected static void reportUnresolvableKeyException(String keyContent, String keyLocation) throws org.jose4j.lang.UnresolvableKeyException - Throws:
org.jose4j.lang.UnresolvableKeyException
-
tryAsJwk
protected org.jose4j.jwk.JsonWebKey tryAsJwk(org.jose4j.jwx.JsonWebStructure jws, String configuredAlgo) throws org.jose4j.lang.UnresolvableKeyException - Throws:
org.jose4j.lang.UnresolvableKeyException
-
getHttpsJwk
-
getJsonWebKey
-
tryJWKContent
-
loadJWKContent
-
loadFromJwk
-
getSecretKeyFromJwk
-
loadPEMCertificate
-