Removed @PostConstruct; placed buildSignersAndVerifiers() calls inside both constructors.
parent
c22cd62977
commit
85d9e07a94
|
@ -24,8 +24,6 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.mitre.jose.keystore.JWKSetKeyStore;
|
||||
import org.mitre.jwt.signer.service.JwtSigningAndValidationService;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -77,7 +75,7 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
|
|||
*/
|
||||
public DefaultJwtSigningAndValidationService(Map<String, JWK> keys) throws NoSuchAlgorithmException, InvalidKeySpecException {
|
||||
this.keys = keys;
|
||||
//buildSignersAndVerifiers();
|
||||
buildSignersAndVerifiers();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,21 +101,10 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
|
|||
}
|
||||
}
|
||||
}
|
||||
//buildSignersAndVerifiers();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException{
|
||||
|
||||
if (keys == null) {
|
||||
throw new IllegalArgumentException("Signing and validation service must have at least one key configured.");
|
||||
}
|
||||
|
||||
buildSignersAndVerifiers();
|
||||
|
||||
logger.info("DefaultJwtSigningAndValidationService is ready: " + this.toString());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the defaultSignerKeyId
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue