use of eu.unicore.util.configuration.ConfigurationException in project unity by unity-idm.
the class TokenSigner method setupRSASigner.
private void setupRSASigner() {
PrivateKey pk = credential.getKey();
if (pk == null || !(pk instanceof RSAPrivateKey)) {
throw new ConfigurationException("The private key must be RSA if one of RS signingAlgorithm is used");
}
internalSigner = new RSASSASigner(pk);
}
use of eu.unicore.util.configuration.ConfigurationException in project unity by unity-idm.
the class TokenSigner method setupECSigner.
private void setupECSigner(String signAlg) {
PrivateKey pk = credential.getKey();
if (pk == null || !(pk instanceof ECPrivateKey)) {
throw new ConfigurationException("The private key must be EC if one of ES signingAlgorithm is used");
}
try {
ECPrivateKey ecPrivateKey = (ECPrivateKey) pk;
internalSigner = new ECDSASigner(ecPrivateKey);
curve = Curve.forECParameterSpec(ecPrivateKey.getParams());
} catch (JOSEException e) {
throw new ConfigurationException("The EC key is incorrect", e);
}
if (!internalSigner.supportedJWSAlgorithms().contains(JWSAlgorithm.parse(signAlg)))
throw new ConfigurationException("privateKey is not compatible with used ES algorithm");
}
use of eu.unicore.util.configuration.ConfigurationException in project unity by unity-idm.
the class OAuthAuthzWebEndpoint method setSerializedConfiguration.
@Override
public void setSerializedConfiguration(String properties) {
super.setSerializedConfiguration(properties);
try {
oauthProperties = new OAuthASProperties(this.properties, pkiManagement, getServletUrl(OAUTH_CONSUMER_SERVLET_PATH));
coordinator.registerAuthzEndpoint(oauthProperties.getValue(OAuthASProperties.ISSUER_URI), getServletUrl(OAUTH_CONSUMER_SERVLET_PATH));
} catch (Exception e) {
throw new ConfigurationException("Can't initialize the OAuth 2 AS endpoint's configuration", e);
}
}
use of eu.unicore.util.configuration.ConfigurationException in project unity by unity-idm.
the class SMSRetrieval method setSerializedConfiguration.
@Override
public void setSerializedConfiguration(String configuration) {
this.configuration = configuration;
try {
Properties properties = new Properties();
properties.load(new StringReader(configuration));
SMSRetrievalProperties config = new SMSRetrievalProperties(properties);
name = config.getLocalizedString(msg, SMSRetrievalProperties.NAME);
if (name.isEmpty())
name = new I18nString("WebSMSRetrieval.title", msg);
} catch (Exception e) {
throw new ConfigurationException("The configuration of the web-" + "based SMS retrieval can not be parsed", e);
}
}
use of eu.unicore.util.configuration.ConfigurationException in project unity by unity-idm.
the class TLSRetrieval method setSerializedConfiguration.
@Override
public void setSerializedConfiguration(String configuration) {
this.configuration = configuration;
try {
Properties properties = new Properties();
properties.load(new StringReader(configuration));
TLSRetrievalProperties config = new TLSRetrievalProperties(properties);
name = config.getLocalizedString(msg, TLSRetrievalProperties.NAME);
if (name.isEmpty())
name = new I18nString("WebTLSRetrieval.title", msg);
registrationFormForUnknown = config.getValue(TLSRetrievalProperties.REGISTRATION_FORM_FOR_UNKNOWN);
enableAssociation = config.getBooleanValue(TLSRetrievalProperties.ENABLE_ASSOCIATION);
} catch (Exception e) {
throw new ConfigurationException("The configuration of the web-" + "based TLS retrieval can not be parsed", e);
}
}
Aggregations