Hi, 

Having got Xwiki to produce RDFa (very easy), and having switched of Twitter to 
allow me to concentrate,I am now working on allowing a user to click a button 
in his profile, and have it create a foaf+ssl certificate (which is just a 
normal certificate, but with a URL in the subject alternative name). The code 
for this is very simple:

http://github.com/harbulot/keygenapp/blob/master/samplewebapp/src/main/java/uk/ac/manchester/_rcs/bruno/keygenapp/webapp/MiniCaServlet.java

(with a few lines of tweaks required to add the certificate information to the 
profile page).

What happens is that a <keygen> XML element is added to a <form> element in the 
user's profile page. This forces the browser (Safari, Firefox, Opera) to create 
a <public, private> key pair and send the public part to the servlet referred 
to above (MiniCaServlet). That servlet creates a certificate and sends it back 
to an invisible iframe. The browser then adds that cert to the keystore (this 
is done automatically, it's part of browser behavior).

  So to move this code to XWiki, I understand I should create a component. I 
read about it here:

   http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents

  and it makes sense. From a component I can get the user, and from that I can 
get his profile page, and then I can add the public key information to his 
profile (I wrote a RSAKeyClass in Xwiki to do this). 

  The component should finally send the newly generated certificate back to the 
client, which it can do because it has access the the HTTPServletResponse.

  But where would I put such a component? In a specific wiki page?

Does all that make sense? If not let me know before I go and code it up.

  Henry

PS. It would be fun later to have the User's Profile page be a bit Ajaxy, so 
that if it notices a change to the invisible iframe the browser can make a 
reques to XWiki to refresh the table of public keys displayed to the user.

Social Web Architect
http://bblfish.net/

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to