Class IdTokenVerifier.PublicKeyLoader
- java.lang.Object
-
- com.google.common.cache.CacheLoader<java.lang.String,java.util.Map<java.lang.String,java.security.PublicKey>>
-
- com.google.api.client.auth.openidconnect.IdTokenVerifier.PublicKeyLoader
-
- Enclosing class:
- IdTokenVerifier
static class IdTokenVerifier.PublicKeyLoader extends com.google.common.cache.CacheLoader<java.lang.String,java.util.Map<java.lang.String,java.security.PublicKey>>Custom CacheLoader for mapping certificate urls to the contained public keys.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIdTokenVerifier.PublicKeyLoader.JsonWebKeyData class used for deserializing a single JSON Web Key.static classIdTokenVerifier.PublicKeyLoader.JsonWebKeySetData class used for deserializing a JSON Web Key Set (JWKS) from an external HTTP request.
-
Field Summary
Fields Modifier and Type Field Description private HttpTransportFactoryhttpTransportFactory
-
Constructor Summary
Constructors Constructor Description PublicKeyLoader(HttpTransportFactory httpTransportFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.security.PublicKeybuildEs256PublicKey(IdTokenVerifier.PublicKeyLoader.JsonWebKey key)private java.security.PublicKeybuildPublicKey(IdTokenVerifier.PublicKeyLoader.JsonWebKey key)private java.security.PublicKeybuildPublicKey(java.lang.String publicPem)private java.security.PublicKeybuildRs256PublicKey(IdTokenVerifier.PublicKeyLoader.JsonWebKey key)java.util.Map<java.lang.String,java.security.PublicKey>load(java.lang.String certificateUrl)
-
-
-
Field Detail
-
httpTransportFactory
private final HttpTransportFactory httpTransportFactory
-
-
Constructor Detail
-
PublicKeyLoader
PublicKeyLoader(HttpTransportFactory httpTransportFactory)
-
-
Method Detail
-
load
public java.util.Map<java.lang.String,java.security.PublicKey> load(java.lang.String certificateUrl) throws java.lang.Exception- Specified by:
loadin classcom.google.common.cache.CacheLoader<java.lang.String,java.util.Map<java.lang.String,java.security.PublicKey>>- Throws:
java.lang.Exception
-
buildPublicKey
private java.security.PublicKey buildPublicKey(IdTokenVerifier.PublicKeyLoader.JsonWebKey key) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidParameterSpecException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidParameterSpecExceptionjava.security.spec.InvalidKeySpecException
-
buildPublicKey
private java.security.PublicKey buildPublicKey(java.lang.String publicPem) throws java.security.cert.CertificateException, java.io.UnsupportedEncodingException- Throws:
java.security.cert.CertificateExceptionjava.io.UnsupportedEncodingException
-
buildRs256PublicKey
private java.security.PublicKey buildRs256PublicKey(IdTokenVerifier.PublicKeyLoader.JsonWebKey key) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidKeySpecException
-
buildEs256PublicKey
private java.security.PublicKey buildEs256PublicKey(IdTokenVerifier.PublicKeyLoader.JsonWebKey key) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidParameterSpecException, java.security.spec.InvalidKeySpecException
- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidParameterSpecExceptionjava.security.spec.InvalidKeySpecException
-
-