Author: reto
Date: Fri Jul 30 21:55:17 2010
New Revision: 980978

URL: http://svn.apache.org/viewvc?rev=980978&view=rev
Log:
CLEREZZA-243: bnode for public keys

Modified:
    
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java
    
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-panel.ssp
    
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/scripts/profile.js

Modified: 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java?rev=980978&r1=980977&r2=980978&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/java/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.java
 Fri Jul 30 21:55:17 2010
@@ -35,6 +35,7 @@ import net.bblfish.dev.foafssl.keygen.Ce
 import net.bblfish.dev.foafssl.keygen.Certificate;
 import net.bblfish.dev.foafssl.keygen.RSAPubKey;
 import net.bblfish.dev.foafssl.keygen.impl.StaticKeygenService;
+import org.apache.clerezza.foafssl.ontologies.CERT;
 import org.apache.clerezza.foafssl.ontologies.RSA;
 import org.apache.clerezza.jaxrs.utils.RedirectUtil;
 import org.apache.felix.scr.annotations.Component;
@@ -204,6 +205,7 @@ public class ProfilePanel extends FileSe
        public Response createCert(@FormParam("webId") UriRef webId,
                        @FormParam("cn") String commonName,
                        @FormParam("spkac") String spkac,
+                       @FormParam("crmf") String crmf,
                        @FormParam("hours") String hours,
                        @FormParam("days") String days) {
                logger.info("in keygen code. webId={}", webId);
@@ -236,9 +238,12 @@ public class ProfilePanel extends FileSe
                BigInteger publicExponent = pubKey.getPublicExponent();
                BigInteger modulus = pubKey.getModulus();
                final WebIdGraphsService.WebIdGraphs webIdGraphs = 
webIdGraphsService.getWebIdGraphs(webId);
+               final GraphNode certNode = new GraphNode(new BNode(), 
webIdGraphs.localGraph());
+               certNode.addProperty(RDF.type, RSA.RSAPublicKey);
+               certNode.addProperty(CERT.identity, webId);
                final GraphNode agent = new GraphNode(webId, 
webIdGraphs.localGraph());
-               agent.addPropertyValue(RSA.modulus, modulus);
-               agent.addPropertyValue(RSA.public_exponent, publicExponent);
+               certNode.addPropertyValue(RSA.modulus, modulus);
+               certNode.addPropertyValue(RSA.public_exponent, publicExponent);
 
                Response.ResponseBuilder resBuild = 
Response.ok(ser.getContent(), MediaType.valueOf(ser.getMimeType()));
                return resBuild.build();
@@ -258,8 +263,7 @@ public class ProfilePanel extends FileSe
                agent.addPropertyValue(FOAF.name, name);
                agent.deleteProperties(DC.description);
                agent.addPropertyValue(DC.description, description);
-               logger.info("desc:" + description);
-               logger.info("local graph (uri: {}) is now of size {}", 
webIdGraphs.localGraphUri(), webIdGraphs.localGraph().size());
+               logger.debug("local graph (uri: {}) is now of size {}", 
webIdGraphs.localGraphUri(), webIdGraphs.localGraph().size());
                return RedirectUtil.createSeeOtherResponse("../profile", 
uriInfo);
        }
 }

Modified: 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-panel.ssp
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-panel.ssp?rev=980978&r1=980977&r2=980978&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-panel.ssp
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-panel.ssp
 Fri Jul 30 21:55:17 2010
@@ -92,17 +92,13 @@ def existingLocalWebId() = {
                  <h1>web-is stuff</h1>
 
        <form id="keygenform" method="post" action="profile/keygen">
+               <input name="webId" size="60" id="webId" type="hidden" 
value={agent*} />
       <table width="95%">
         <tr>
-          <td>Common Name:</td>
+          <td>Common Name (for identifying certificate in browser):</td>
           <td>
-              <input name="cn" size="30" id="cn" type="text" 
value="m...@clerezza"/> <!-- find some way perhaps to get hostname-->
-          </td>
-        </tr>
-        <tr>
-          <td>WebID:</td>
-          <td>
-            <input name="webId" size="60" id="webId" type="text" 
value={agent*} />
+              <input name="cn" size="30" id="cn" type="text" value={import 
java.net.URI
+                         ((agent/FOAF.name*)+" @ "+new 
URI(agent*).getAuthority)}/>
           </td>
         </tr>
         <tr>

Modified: 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/scripts/profile.js
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/scripts/profile.js?rev=980978&r1=980977&r2=980978&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/scripts/profile.js
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-243/org.apache.clerezza.platform.accountcontrolpanel/org.apache.clerezza.platform.accountcontrolpanel.core/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/profile-staticweb/scripts/profile.js
 Fri Jul 30 21:55:17 2010
@@ -21,19 +21,14 @@ function setCRMFRequest() {
        function(data) {
                alert("congrats");
        });
-       $("#keygenform").submit(function() {
-               return spkacFix();
-       });
 }
 
 function spkacFix() {
-       alert("hello")
-       alert("cn ="+$("#cn").val())
-       alert("key ="+$("#keygen").val())
-       if ($("#keygen").val()) {
-               alert("no fix needed")
+
+       if ($("#spkac").val()) {
                return true;
        } else {
+               alert("fix needed by firefox in xhtml mode")
                crmfObject = crypto.generateCRMFRequest(
                'CN=Fred',
                "regToken", "authenticator", // not sure


Reply via email to