mitreid-connect
クラス | 公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.mitre.jwt.signer.service.impl.ClientKeyCacheService クラス
org.mitre.jwt.signer.service.impl.ClientKeyCacheService 連携図
Collaboration graph

クラス

class  JWKSetEncryptorBuilder
 
class  JWKSetVerifierBuilder
 

公開メンバ関数

 ClientKeyCacheService ()
 
JWTSigningAndValidationService getValidator (ClientDetailsEntity client, JWSAlgorithm alg)
 
JWTEncryptionAndDecryptionService getEncrypter (ClientDetailsEntity client)
 

非公開変数類

JWKSetCacheService jwksUriCache = new JWKSetCacheService()
 
SymmetricKeyJWTValidatorCacheService symmetricCache = new SymmetricKeyJWTValidatorCacheService()
 
LoadingCache< JWKSet, JWTSigningAndValidationServicejwksValidators
 
LoadingCache< JWKSet, JWTEncryptionAndDecryptionServicejwksEncrypters
 

静的非公開変数類

static Logger logger = LoggerFactory.getLogger(ClientKeyCacheService.class)
 

詳解

Takes in a client and returns the appropriate validator or encrypter for that client's registered key types.

著者
jricher

構築子と解体子

◆ ClientKeyCacheService()

org.mitre.jwt.signer.service.impl.ClientKeyCacheService.ClientKeyCacheService ( )
inline
65  {
66  this.jwksValidators = CacheBuilder.newBuilder()
67  .expireAfterWrite(1, TimeUnit.HOURS) // expires 1 hour after fetch
68  .maximumSize(100)
69  .build(new JWKSetVerifierBuilder());
70  this.jwksEncrypters = CacheBuilder.newBuilder()
71  .expireAfterWrite(1, TimeUnit.HOURS) // expires 1 hour after fetch
72  .maximumSize(100)
73  .build(new JWKSetEncryptorBuilder());
74  }
LoadingCache< JWKSet, JWTSigningAndValidationService > jwksValidators
Definition: ClientKeyCacheService.java:60
LoadingCache< JWKSet, JWTEncryptionAndDecryptionService > jwksEncrypters
Definition: ClientKeyCacheService.java:63

関数詳解

◆ getEncrypter()

JWTEncryptionAndDecryptionService org.mitre.jwt.signer.service.impl.ClientKeyCacheService.getEncrypter ( ClientDetailsEntity  client)
inline
118  {
119 
120  try {
121  if (client.getJwks() != null) {
122  return jwksEncrypters.get(client.getJwks());
123  } else if (!Strings.isNullOrEmpty(client.getJwksUri())) {
124  return jwksUriCache.getEncrypter(client.getJwksUri());
125  } else {
126  return null;
127  }
128  } catch (UncheckedExecutionException | ExecutionException e) {
129  logger.error("Problem loading client encrypter", e);
130  return null;
131  }
132 
133  }
JWKSetCacheService jwksUriCache
Definition: ClientKeyCacheService.java:54
static Logger logger
Definition: ClientKeyCacheService.java:51
JWTEncryptionAndDecryptionService getEncrypter(String jwksUri)
Definition: JWKSetCacheService.java:94
LoadingCache< JWKSet, JWTEncryptionAndDecryptionService > jwksEncrypters
Definition: ClientKeyCacheService.java:63

◆ getValidator()

JWTSigningAndValidationService org.mitre.jwt.signer.service.impl.ClientKeyCacheService.getValidator ( ClientDetailsEntity  client,
JWSAlgorithm  alg 
)
inline
77  {
78 
79  try {
80  if (alg.equals(JWSAlgorithm.RS256)
81  || alg.equals(JWSAlgorithm.RS384)
82  || alg.equals(JWSAlgorithm.RS512)
83  || alg.equals(JWSAlgorithm.ES256)
84  || alg.equals(JWSAlgorithm.ES384)
85  || alg.equals(JWSAlgorithm.ES512)
86  || alg.equals(JWSAlgorithm.PS256)
87  || alg.equals(JWSAlgorithm.PS384)
88  || alg.equals(JWSAlgorithm.PS512)) {
89 
90  // asymmetric key
91  if (client.getJwks() != null) {
92  return jwksValidators.get(client.getJwks());
93  } else if (!Strings.isNullOrEmpty(client.getJwksUri())) {
94  return jwksUriCache.getValidator(client.getJwksUri());
95  } else {
96  return null;
97  }
98 
99  } else if (alg.equals(JWSAlgorithm.HS256)
100  || alg.equals(JWSAlgorithm.HS384)
101  || alg.equals(JWSAlgorithm.HS512)) {
102 
103  // symmetric key
104 
105  return symmetricCache.getSymmetricValidtor(client);
106 
107  } else {
108 
109  return null;
110  }
111  } catch (UncheckedExecutionException | ExecutionException e) {
112  logger.error("Problem loading client validator", e);
113  return null;
114  }
115 
116  }
JWKSetCacheService jwksUriCache
Definition: ClientKeyCacheService.java:54
SymmetricKeyJWTValidatorCacheService symmetricCache
Definition: ClientKeyCacheService.java:57
JWTSigningAndValidationService getSymmetricValidtor(ClientDetailsEntity client)
Definition: SymmetricKeyJWTValidatorCacheService.java:72
LoadingCache< JWKSet, JWTSigningAndValidationService > jwksValidators
Definition: ClientKeyCacheService.java:60
JWTSigningAndValidationService getValidator(String jwksUri)
Definition: JWKSetCacheService.java:85
static Logger logger
Definition: ClientKeyCacheService.java:51

メンバ詳解

◆ jwksEncrypters

LoadingCache<JWKSet, JWTEncryptionAndDecryptionService> org.mitre.jwt.signer.service.impl.ClientKeyCacheService.jwksEncrypters
private

◆ jwksUriCache

JWKSetCacheService org.mitre.jwt.signer.service.impl.ClientKeyCacheService.jwksUriCache = new JWKSetCacheService()
private

◆ jwksValidators

LoadingCache<JWKSet, JWTSigningAndValidationService> org.mitre.jwt.signer.service.impl.ClientKeyCacheService.jwksValidators
private

◆ logger

Logger org.mitre.jwt.signer.service.impl.ClientKeyCacheService.logger = LoggerFactory.getLogger(ClientKeyCacheService.class)
staticprivate

◆ symmetricCache

SymmetricKeyJWTValidatorCacheService org.mitre.jwt.signer.service.impl.ClientKeyCacheService.symmetricCache = new SymmetricKeyJWTValidatorCacheService()
private

このクラス詳解は次のファイルから抽出されました: