InputStream keystoreIs = keystore.getInputStream();
byte[] keystoreData = IOUtils.toByteArray(keystoreIs);
IOUtils.closeQuietly(keystoreIs);
SamlConfig authRequestContext = new SamlConfig();
authRequestContext.setKeystore(keystoreData);
authRequestContext.setKeyName(keyName);
authRequestContext.setKeystorePassword(keystorePassword);
authRequestContext.setKeyPassword(keyPassword);
if (appId != null && appId.length() > 0) {
authRequestContext.setProviderName(appId);
}
authRequestBuilder.init(authRequestContext);
}