Removed @PostConstruct; placed buildSignersAndVerifiers() calls inside both constructors.

pull/516/head
Amanda Anganes 2013-09-13 14:44:07 -04:00
parent c22cd62977
commit 85d9e07a94
1 changed files with 9 additions and 22 deletions

View File

@ -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
*/