Added null check;

pull/516/head
Amanda Anganes 11 years ago
parent aecf4958ed
commit c22cd62977

@ -94,6 +94,7 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
*/
public DefaultJwtSigningAndValidationService(JWKSetKeyStore keyStore) throws NoSuchAlgorithmException, InvalidKeySpecException {
// convert all keys in the keystore to a map based on key id
if (keyStore!= null && keyStore.getJwkSet() != null) {
for (JWK key : keyStore.getKeys()) {
if (!Strings.isNullOrEmpty(key.getKeyID())) {
this.keys.put(key.getKeyID(), key);
@ -101,6 +102,7 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
throw new IllegalArgumentException("Tried to load a key from a keystore without a 'kid' field: " + key);
}
}
}
//buildSignersAndVerifiers();
}

Loading…
Cancel
Save