X509Certificate cert;
public HandleServiceSAML( String domain, String AAurl, String HSname,
- String KSpath, String KSpass, String KSkeyalias,
- String KSkeypass, String certalias )
- throws SAMLException, KeyStoreException, IOException, FileNotFoundException, Exception
+ String KSpass, String KSkeyalias,
+ String KSkeypass, String certalias,
+ InputStream is )
+ throws SAMLException, KeyStoreException, IOException, Exception
{
this.domain = domain;
this.AAurl = AAurl;
KeyStore ks = KeyStore.getInstance("JKS");
- FileInputStream fis = new FileInputStream(KSpath);
- ks.load( fis, KSpass.toCharArray());
+ ks.load( is, KSpass.toCharArray());
privateKey = (PrivateKey)ks.getKey(KSkeyalias, KSkeypass.toCharArray());
cert =(X509Certificate)ks.getCertificate(certalias);
getInitParams();
try {
+ InputStream is = getServletContext().getResourceAsStream
+ (getInitParameter("KSpath"));
hsSAML = new HandleServiceSAML( getInitParameter("domain"),
getInitParameter("AAurl"),
getInitParameter("HSname"),
- getInitParameter("KSpath"),
getInitParameter("KSpass"),
getInitParameter("KSkeyalias"),
getInitParameter("KSkeypass"),
- getInitParameter("certalias") );
+ getInitParameter("certalias"),
+ is );
+
hrf = HandleRepositoryFactory.getInstance
( Constants.POLICY_CLUBSHIB, this );
}
throws HandleException {
try {
- res.setContentType("text/html");
+ /* res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE>Handle Service</TITLE></HEAD>");
out.println("<BODY onLoad=\"document.forms[0].submit()\">");
"value=\"" + buf + "\">");
out.println("<input type=\"submit\" value=\"Transmit\">");
out.println("</form>");
-
+ */
/**
* uncomment the following to implement
* forwarding to hs.jsp for submission
- *
+ */
//Hardcoded to ASCII to ensure Base64 encoding compatibility
req.setAttribute("assertion", new String(buf, "ASCII"));
RequestDispatcher rd = req.getRequestDispatcher("/hs.jsp");
rd.forward(req, res);
- */
+
} catch (IOException ex) {
throw new HandleException
("IO interruption while displaying Handle Service UI." + ex);
}
- /*
+
catch (ServletException ex) {
throw new HandleException
("Problem displaying Handle Service UI." + ex);
}
- */
+
}
private void handleError( HttpServletRequest req,
<param-value>org.gjt.mm.mysql.Driver</param-value>
</init-param>
<init-param>
- <param-name>DBdriver</param-name>
- <param-value>org.gjt.mm.mysql.Driver</param-value>
- </init-param>
- <init-param>
<param-name>DBuser</param-name>
<param-value>shib</param-value>
</init-param>
</init-param>
<init-param>
<param-name>KSpath</param-name>
- <param-value>/home/blk/.keystore</param-value>
+ <param-value>/WEB-INF/conf/keystore.dks</param-value>
</init-param>
<init-param>
<param-name>KSpass</param-name>