Author: alexoree
Date: Wed Nov 20 02:28:31 2013
New Revision: 1543695

URL: http://svn.apache.org/r1543695
Log:
JUDDI-719 done, added a panel to get certificate details and options for 
keyinfodata inclusion

Added:
    
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.form
    
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.java
Modified:
    
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
    
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSignatureApplet.java
    juddi/trunk/juddi-gui/src/main/webapp/signer.jsp

Modified: 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java?rev=1543695&r1=1543694&r2=1543695&view=diff
==============================================================================
--- 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
 (original)
+++ 
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
 Wed Nov 20 02:28:31 2013
@@ -137,12 +137,13 @@ public class DigSigUtil {
     public final static String TRUSTSTORE_FILE_PASSWORD = "trustStorePassword";
     /**
      * default is CanonicalizationMethod.EXCLUSIVE
+     * http://www.w3.org/2001/10/xml-exc-c14n#
      *
      * @see CanonicalizationMethod
      */
     public final static String CANONICALIZATIONMETHOD = 
"CanonicalizationMethod";
     /**
-     * default is RSA_SHA1
+     * default is http://www.w3.org/2000/09/xmldsig#rsa-sha1
      *
      * @see SignatureMethod
      */
@@ -191,7 +192,7 @@ public class DigSigUtil {
      * @see SIGNATURE_OPTION_CERT_INCLUSION_BASE64
      */
     public final static String SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN = 
"SUBJECTDN";
-    /**
+    /*
      * Include the signer's X500 Prinicple of the public key.
      *
      * Clients will not be able to validate the signature unless they have a
@@ -207,6 +208,10 @@ public class DigSigUtil {
      * @see SIGNATURE_OPTION_CERT_INCLUSION_BASE64
      */
     //public final static String 
SIGNATURE_OPTION_CERT_INCLUSION_X500_PRINICPAL = "X500";
+
+    /**
+     * This is the namespace of the digital signature. 
+     */
     public final static String XML_DIGSIG_NS = 
"http://www.w3.org/2000/09/xmldsig#";;
     /**
      * Default value DigestMethod.SHA1 =

Added: 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.form
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.form?rev=1543695&view=auto
==============================================================================
--- 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.form
 (added)
+++ 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.form
 Wed Nov 20 02:28:31 2013
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.2" maxVersion="1.8" 
type="org.netbeans.modules.form.forminfo.AppletFormInfo">
+  <NonVisualComponents>
+    <Component class="javax.swing.ButtonGroup" name="buttonGroup1">
+    </Component>
+    <Container class="javax.swing.JPanel" name="jPanel3">
+
+      <Layout 
class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+    </Container>
+  </NonVisualComponents>
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" 
value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" 
type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" 
value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" 
type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" 
value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" 
value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" 
type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" 
value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" 
value="2"/>
+    <AuxValue name="designerSize" type="java.awt.Dimension" 
value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,30,0,0,1,-128"/>
+  </AuxValues>
+
+  <Layout 
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+  <SubComponents>
+    <Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
+      <AccessibilityProperties>
+        <Property name="AccessibleContext.accessibleName" 
type="java.lang.String" value="Sign"/>
+      </AccessibilityProperties>
+      <Constraints>
+        <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+          <BorderConstraints direction="Center"/>
+        </Constraint>
+      </Constraints>
+
+      <Layout 
class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
+      <SubComponents>
+        <Container class="javax.swing.JPanel" name="jPanel1">
+          <Constraints>
+            <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"
 
value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+              <JTabbedPaneConstraints tabName="Sign">
+                <Property name="tabTitle" type="java.lang.String" 
value="Sign"/>
+              </JTabbedPaneConstraints>
+            </Constraint>
+          </Constraints>
+
+          <Layout>
+            <DimensionLayout dim="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="0" attributes="0">
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jScrollPane1" max="32767" attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                  </Group>
+                  <Group type="102" alignment="1" attributes="0">
+                      <EmptySpace pref="69" max="32767" attributes="0"/>
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Component id="jButton2" min="-2" pref="228" 
max="-2" attributes="0"/>
+                          <Component id="jButton1" min="-2" pref="228" 
max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace min="-2" pref="82" max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+            <DimensionLayout dim="1">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="0" attributes="0">
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jScrollPane1" pref="142" max="32767" 
attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Component id="jButton2" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
+                      <Component id="jButton1" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+          </Layout>
+          <SubComponents>
+            <Component class="javax.swing.JButton" name="jButton1">
+              <Properties>
+                <Property name="font" type="java.awt.Font" 
editor="org.netbeans.beaninfo.editors.FontEditor">
+                  <Font name="Tahoma" size="11" style="1"/>
+                </Property>
+                <Property name="text" type="java.lang.String" value="Digitally 
Sign"/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+              </Events>
+            </Component>
+            <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+              <AuxValues>
+                <AuxValue name="autoScrollPane" type="java.lang.Boolean" 
value="true"/>
+              </AuxValues>
+
+              <Layout 
class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+              <SubComponents>
+                <Component class="javax.swing.JList" name="jList1">
+                  <Properties>
+                    <Property name="model" type="javax.swing.ListModel" 
editor="org.netbeans.modules.form.editors2.ListModelEditor">
+                      <StringArray count="0"/>
+                    </Property>
+                  </Properties>
+                </Component>
+              </SubComponents>
+            </Container>
+            <Component class="javax.swing.JButton" name="jButton2">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Show 
Certificate Details"/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
+              </Events>
+            </Component>
+          </SubComponents>
+        </Container>
+        <Container class="javax.swing.JPanel" name="jPanel2">
+          <Constraints>
+            <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"
 
value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+              <JTabbedPaneConstraints tabName="Settings">
+                <Property name="tabTitle" type="java.lang.String" 
value="Settings"/>
+              </JTabbedPaneConstraints>
+            </Constraint>
+          </Constraints>
+
+          <Layout>
+            <DimensionLayout dim="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" attributes="0">
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Component id="jTextFieldDigestMethod" max="32767" 
attributes="0"/>
+                          <Component id="jTextFieldSigMethod" alignment="0" 
max="32767" attributes="0"/>
+                          <Group type="102" attributes="0">
+                              <Group type="103" groupAlignment="0" 
attributes="0">
+                                  <Component id="jLabel1" min="-2" max="-2" 
attributes="0"/>
+                                  <Component id="jLabel2" alignment="0" 
min="-2" max="-2" attributes="0"/>
+                                  <Component id="isIncludeIssuer" min="-2" 
max="-2" attributes="0"/>
+                                  <Component id="isIncludePublicKey" 
alignment="0" min="-2" max="-2" attributes="0"/>
+                                  <Component id="isIncludeSubjectName" 
alignment="0" min="-2" max="-2" attributes="0"/>
+                                  <Component id="jLabel3" alignment="0" 
min="-2" max="-2" attributes="0"/>
+                                  <Component id="jLabel4" alignment="0" 
min="-2" max="-2" attributes="0"/>
+                              </Group>
+                              <EmptySpace min="0" pref="0" max="32767" 
attributes="0"/>
+                          </Group>
+                          <Component id="jTextFieldc14n" alignment="0" 
pref="359" max="32767" attributes="0"/>
+                      </Group>
+                      <EmptySpace max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+            <DimensionLayout dim="1">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="0" attributes="0">
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jLabel1" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="isIncludePublicKey" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="isIncludeSubjectName" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="isIncludeIssuer" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                      <Component id="jLabel2" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jTextFieldSigMethod" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jLabel3" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jTextFieldDigestMethod" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jLabel4" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jTextFieldc14n" min="-2" max="-2" 
attributes="0"/>
+                      <EmptySpace pref="23" max="32767" attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+          </Layout>
+          <SubComponents>
+            <Component class="javax.swing.JLabel" name="jLabel1">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Advanced 
Settings"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JCheckBox" 
name="isIncludeSubjectName">
+              <Properties>
+                <Property name="selected" type="boolean" value="true"/>
+                <Property name="text" type="java.lang.String" value="Include 
your certificate&apos;s subject name"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JCheckBox" name="isIncludePublicKey">
+              <Properties>
+                <Property name="selected" type="boolean" value="true"/>
+                <Property name="text" type="java.lang.String" value="Include 
your public key in the signature (recommended)"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JCheckBox" name="isIncludeIssuer">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Include 
your certificate&apos;s issuer and your certificate&apos;s serial"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JLabel" name="jLabel2">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Signature 
Method"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JTextField" 
name="jTextFieldSigMethod">
+              <Properties>
+                <Property name="text" type="java.lang.String" 
value="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JLabel" name="jLabel3">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Digest 
Method"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JTextField" 
name="jTextFieldDigestMethod">
+              <Properties>
+                <Property name="text" type="java.lang.String" 
value="http://www.w3.org/2000/09/xmldsig#sha1"/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="jTextFieldDigestMethodActionPerformed"/>
+              </Events>
+            </Component>
+            <Component class="javax.swing.JLabel" name="jLabel4">
+              <Properties>
+                <Property name="text" type="java.lang.String" 
value="Canonicalization Method"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JTextField" name="jTextFieldc14n">
+              <Properties>
+                <Property name="text" type="java.lang.String" 
value="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" 
listener="java.awt.event.ActionListener" 
parameters="java.awt.event.ActionEvent" 
handler="jTextFieldc14nActionPerformed"/>
+              </Events>
+            </Component>
+          </SubComponents>
+        </Container>
+        <Container class="javax.swing.JPanel" name="jPanel4">
+          <Constraints>
+            <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"
 
value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+              <JTabbedPaneConstraints tabName="Info">
+                <Property name="tabTitle" type="java.lang.String" 
value="Info"/>
+              </JTabbedPaneConstraints>
+            </Constraint>
+          </Constraints>
+
+          <Layout>
+            <DimensionLayout dim="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="0" attributes="0">
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jScrollPane2" pref="359" max="32767" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+            <DimensionLayout dim="1">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Group type="102" alignment="0" attributes="0">
+                      <EmptySpace max="-2" attributes="0"/>
+                      <Component id="jScrollPane2" pref="236" max="32767" 
attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+            </DimensionLayout>
+          </Layout>
+          <SubComponents>
+            <Container class="javax.swing.JScrollPane" name="jScrollPane2">
+              <AuxValues>
+                <AuxValue name="autoScrollPane" type="java.lang.Boolean" 
value="true"/>
+              </AuxValues>
+
+              <Layout 
class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+              <SubComponents>
+                <Component class="javax.swing.JTextArea" name="jTextArea1">
+                  <Properties>
+                    <Property name="columns" type="int" value="20"/>
+                    <Property name="rows" type="int" value="5"/>
+                  </Properties>
+                </Component>
+              </SubComponents>
+            </Container>
+          </SubComponents>
+        </Container>
+      </SubComponents>
+    </Container>
+  </SubComponents>
+</Form>

Added: 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.java?rev=1543695&view=auto
==============================================================================
--- 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.java
 (added)
+++ 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSigApplet2.java
 Wed Nov 20 02:28:31 2013
@@ -0,0 +1,579 @@
+/*
+ * Copyright 2013 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.gui.dsig;
+
+import java.io.File;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.Key;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.Popup;
+import javax.swing.PopupFactory;
+import javax.xml.bind.JAXB;
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.SignatureMethod;
+import javax.xml.crypto.dsig.SignedInfo;
+import javax.xml.crypto.dsig.Transform;
+import javax.xml.crypto.dsig.XMLSignature;
+import javax.xml.crypto.dsig.XMLSignatureFactory;
+import javax.xml.crypto.dsig.dom.DOMSignContext;
+import javax.xml.crypto.dsig.keyinfo.KeyInfo;
+import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
+import javax.xml.crypto.dsig.keyinfo.X509Data;
+import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
+import javax.xml.crypto.dsig.spec.TransformParameterSpec;
+import netscape.javascript.JSObject;
+import org.apache.juddi.v3.client.cryptor.DigSigUtil;
+import org.uddi.api_v3.BindingTemplate;
+import org.uddi.api_v3.BusinessEntity;
+import org.uddi.api_v3.BusinessService;
+import org.uddi.api_v3.TModel;
+import org.w3c.dom.Node;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSSerializer;
+
+/**
+ *
+ * @author Daddy
+ */
+public class XmlSigApplet2 extends java.applet.Applet {
+
+    /**
+     * Initializes the applet XmlSigApplet2
+     */
+    public void init() {
+        try {
+            java.awt.EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    initComponents();
+                }
+            });
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        setupCertificates();
+
+    }
+
+    private XMLSignatureFactory initXMLSigFactory() {
+        XMLSignatureFactory fac = XMLSignatureFactory.getInstance();
+        return fac;
+    }
+
+    private Reference initReference(XMLSignatureFactory fac) throws 
NoSuchAlgorithmException, InvalidAlgorithmParameterException {
+        List transformers = new ArrayList();
+        transformers.add(fac.newTransform(Transform.ENVELOPED, 
(TransformParameterSpec) null));
+
+        //  String dm = map.getProperty(SIGNATURE_OPTION_DIGEST_METHOD);
+        //if (dm == null) {
+        String dm = DigestMethod.SHA1;
+        //}
+        Reference ref = fac.newReference("", fac.newDigestMethod(dm, null), 
transformers, null, null);
+        return ref;
+    }
+
+    private SignedInfo initSignedInfo(XMLSignatureFactory fac) throws 
Exception {
+        Reference ref = initReference(fac);
+        SignedInfo si = 
fac.newSignedInfo(fac.newCanonicalizationMethod(CanonicalizationMethod.EXCLUSIVE,
+                (C14NMethodParameterSpec) null),
+                fac.newSignatureMethod(SignatureMethod.RSA_SHA1,
+                null),
+                Collections.singletonList(ref));
+        return si;
+    }
+
+    /**
+     * this converts a xml document to a string for writing back to the browser
+     *
+     * @param doc
+     * @return
+     */
+    public String getStringFromDoc(org.w3c.dom.Document doc) {
+        DOMImplementationLS domImplementation = (DOMImplementationLS) 
doc.getImplementation();
+        LSSerializer lsSerializer = domImplementation.createLSSerializer();
+        lsSerializer.getDomConfig().setParameter("xml-declaration", false);
+        //lsSerializer.getDomConfig().setParameter("xml-declaration", false);
+
+        return lsSerializer.writeToString(doc);
+    }
+    KeyStore keyStore = null;
+    KeyStore firefox = null;
+
+    private void setupCertificates() {
+
+        this.jList1.clearSelection();
+        this.jList1.removeAll();
+        Vector<String> certs = new Vector<String>();
+
+        //covers all modern browsers in windows
+        try {
+            keyStore = KeyStore.getInstance("Windows-MY");
+            keyStore.load(null, null);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            //JOptionPane.showMessageDialog(this, ex.getMessage());
+        }
+        //firefox keystore
+        if (keyStore != null) {
+
+            try {
+
+                String strCfg = System.getProperty("user.home") + 
File.separator
+                        + "jdk6-nss-mozilla.cfg";
+                //   Provider p1 = new sun.security.pkcs11.SunPKCS11(strCfg);
+                //   Security.addProvider(p1);
+                keyStore = KeyStore.getInstance("PKCS11");
+                keyStore.load(null, "password".toCharArray());
+            } catch (Exception ex) {
+                //JOptionPane.showMessageDialog(this, ex.getMessage());
+                ex.printStackTrace();
+            }
+        }
+        //MacOS with Safari possibly others
+        if (keyStore != null) {
+            try {
+                keyStore = KeyStore.getInstance("KeychainStore");
+                keyStore.load(null, null);
+
+            } catch (Exception ex) {
+                //JOptionPane.showMessageDialog(this, ex.getMessage());
+                ex.printStackTrace();
+            }
+        }
+        try {
+            //printMessageToConsole("Key Store loaded");
+            Enumeration<String> aliases = keyStore.aliases();
+
+            while (aliases.hasMoreElements()) {
+                String a = aliases.nextElement();
+                X509Certificate certificate = (X509Certificate) 
keyStore.getCertificate(a);
+                //PublicKey publicKey = certificate.getPublicKey();
+                //  X509Certificate cert = (X509Certificate) publicKey;
+                try {
+                    Key key = keyStore.getKey(a, null);
+                    certs.add(a);
+
+                } catch (Exception x) {
+                    System.out.println("error loading certificate " + a + " " 
+ x.getMessage());
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            JOptionPane.showMessageDialog(this, e.getMessage());
+        }
+        jList1.setListData(certs);
+        if (!certs.isEmpty()) {
+            jList1.setSelectedIndex(0);
+        }
+    }
+
+    /**
+     * This method is called from within the init() method to initialize the
+     * form. WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc="Generated 
Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        buttonGroup1 = new javax.swing.ButtonGroup();
+        jPanel3 = new javax.swing.JPanel();
+        jTabbedPane1 = new javax.swing.JTabbedPane();
+        jPanel1 = new javax.swing.JPanel();
+        jButton1 = new javax.swing.JButton();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jList1 = new javax.swing.JList();
+        jButton2 = new javax.swing.JButton();
+        jPanel2 = new javax.swing.JPanel();
+        jLabel1 = new javax.swing.JLabel();
+        isIncludeSubjectName = new javax.swing.JCheckBox();
+        isIncludePublicKey = new javax.swing.JCheckBox();
+        isIncludeIssuer = new javax.swing.JCheckBox();
+        jLabel2 = new javax.swing.JLabel();
+        jTextFieldSigMethod = new javax.swing.JTextField();
+        jLabel3 = new javax.swing.JLabel();
+        jTextFieldDigestMethod = new javax.swing.JTextField();
+        jLabel4 = new javax.swing.JLabel();
+        jTextFieldc14n = new javax.swing.JTextField();
+        jPanel4 = new javax.swing.JPanel();
+        jScrollPane2 = new javax.swing.JScrollPane();
+        jTextArea1 = new javax.swing.JTextArea();
+
+        setLayout(new java.awt.BorderLayout());
+
+        jButton1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
+        jButton1.setText("Digitally Sign");
+        jButton1.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButton1ActionPerformed(evt);
+            }
+        });
+
+        jScrollPane1.setViewportView(jList1);
+
+        jButton2.setText("Show Certificate Details");
+        jButton2.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButton2ActionPerformed(evt);
+            }
+        });
+
+        javax.swing.GroupLayout jPanel1Layout = new 
javax.swing.GroupLayout(jPanel1);
+        jPanel1.setLayout(jPanel1Layout);
+        jPanel1Layout.setHorizontalGroup(
+            
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel1Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane1)
+                .addContainerGap())
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, 
jPanel1Layout.createSequentialGroup()
+                .addContainerGap(69, Short.MAX_VALUE)
+                
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jButton2, 
javax.swing.GroupLayout.PREFERRED_SIZE, 228, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jButton1, 
javax.swing.GroupLayout.PREFERRED_SIZE, 228, 
javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addGap(82, 82, 82))
+        );
+        jPanel1Layout.setVerticalGroup(
+            
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel1Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane1, 
javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
+                .addGap(18, 18, 18)
+                .addComponent(jButton2)
+                .addGap(30, 30, 30)
+                .addComponent(jButton1)
+                .addContainerGap())
+        );
+
+        jTabbedPane1.addTab("Sign", jPanel1);
+
+        jLabel1.setText("Advanced Settings");
+
+        isIncludeSubjectName.setSelected(true);
+        isIncludeSubjectName.setText("Include your certificate's subject 
name");
+
+        isIncludePublicKey.setSelected(true);
+        isIncludePublicKey.setText("Include your public key in the signature 
(recommended)");
+
+        isIncludeIssuer.setText("Include your certificate's issuer and your 
certificate's serial");
+
+        jLabel2.setText("Signature Method");
+
+        
jTextFieldSigMethod.setText("http://www.w3.org/2000/09/xmldsig#rsa-sha1";);
+
+        jLabel3.setText("Digest Method");
+
+        
jTextFieldDigestMethod.setText("http://www.w3.org/2000/09/xmldsig#sha1";);
+        jTextFieldDigestMethod.addActionListener(new 
java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jTextFieldDigestMethodActionPerformed(evt);
+            }
+        });
+
+        jLabel4.setText("Canonicalization Method");
+
+        jTextFieldc14n.setText("http://www.w3.org/2001/10/xml-exc-c14n#";);
+        jTextFieldc14n.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jTextFieldc14nActionPerformed(evt);
+            }
+        });
+
+        javax.swing.GroupLayout jPanel2Layout = new 
javax.swing.GroupLayout(jPanel2);
+        jPanel2.setLayout(jPanel2Layout);
+        jPanel2Layout.setHorizontalGroup(
+            
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel2Layout.createSequentialGroup()
+                .addContainerGap()
+                
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jTextFieldDigestMethod)
+                    .addComponent(jTextFieldSigMethod)
+                    .addGroup(jPanel2Layout.createSequentialGroup()
+                        
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addComponent(jLabel1)
+                            .addComponent(jLabel2)
+                            .addComponent(isIncludeIssuer)
+                            .addComponent(isIncludePublicKey)
+                            .addComponent(isIncludeSubjectName)
+                            .addComponent(jLabel3)
+                            .addComponent(jLabel4))
+                        .addGap(0, 0, Short.MAX_VALUE))
+                    .addComponent(jTextFieldc14n, 
javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE))
+                .addContainerGap())
+        );
+        jPanel2Layout.setVerticalGroup(
+            
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel2Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jLabel1)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(isIncludePublicKey)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(isIncludeSubjectName)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(isIncludeIssuer)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addComponent(jLabel2)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jTextFieldSigMethod, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jLabel3)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jTextFieldDigestMethod, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jLabel4)
+                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jTextFieldc14n, 
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 
javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(23, Short.MAX_VALUE))
+        );
+
+        jTabbedPane1.addTab("Settings", jPanel2);
+
+        jTextArea1.setColumns(20);
+        jTextArea1.setRows(5);
+        jScrollPane2.setViewportView(jTextArea1);
+
+        javax.swing.GroupLayout jPanel4Layout = new 
javax.swing.GroupLayout(jPanel4);
+        jPanel4.setLayout(jPanel4Layout);
+        jPanel4Layout.setHorizontalGroup(
+            
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel4Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane2, 
javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+        jPanel4Layout.setVerticalGroup(
+            
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel4Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane2, 
javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)
+                .addContainerGap())
+        );
+
+        jTabbedPane1.addTab("Info", jPanel4);
+
+        add(jTabbedPane1, java.awt.BorderLayout.CENTER);
+        jTabbedPane1.getAccessibleContext().setAccessibleName("Sign");
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_jButton2ActionPerformed
+        // TODO add your handling code here:]
+        JPopupMenu jp = new JPopupMenu("Certificate Info");
+        String data = "No certificate selected";
+        try {
+            Certificate publickey = keyStore.getCertificate((String) 
jList1.getSelectedValue());
+            data = "Issuer: " + ((X509Certificate) 
publickey).getIssuerDN().getName() + System.getProperty("line.separator");
+            data += "Subject: " + ((X509Certificate) 
publickey).getSubjectDN().getName() + System.getProperty("line.separator");
+            data += "Valid From: " + ((X509Certificate) 
publickey).getNotBefore().toString() + System.getProperty("line.separator");
+            data += "Valid Until: " + ((X509Certificate) 
publickey).getNotAfter().toString() + System.getProperty("line.separator");
+            data += "Serial Number: " + ((X509Certificate) 
publickey).getSerialNumber() + System.getProperty("line.separator");
+        } catch (KeyStoreException ex) {
+            Logger.getLogger(XmlSigApplet2.class.getName()).log(Level.SEVERE, 
null, ex);
+        }
+        jTextArea1.setText(data);
+        jPanel4.setVisible(true);
+        jTabbedPane1.setSelectedIndex(2);
+    }//GEN-LAST:event_jButton2ActionPerformed
+
+    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_jButton1ActionPerformed
+        // TODO add your handling code here:
+        String signedXml = "error!";
+        JSObject window = JSObject.getWindow(this);
+        try {
+            if (keyStore == null || keyStore.size() == 0) {
+                signedXml = "Unforunately, it looks as if you don't have any 
certificates to choose from.";
+                window.call("writeXml", new Object[]{signedXml});
+                return;
+            }
+        } catch (Exception ex) {
+            signedXml = "Unforunately, it looks as if you don't have any 
certificates to choose from.";
+            window.call("writeXml", new Object[]{signedXml});
+            return;
+        }
+        if (jList1.getSelectedValue() == null) {
+            signedXml = "You must pick a certificate first";
+            window.call("writeXml", new Object[]{signedXml});
+            return;
+        }
+
+        Object object2 = window.call("getBrowserName", null);
+        Object object1 = window.call("getOsName", null);
+        Object object3 = window.call("getObjectType", null);
+        String browserName = (String) object2;
+        String osName = (String) object2;
+        String objecttype = (String) object3;
+
+        //get the xml
+        String xml = (String) window.call("getXml", new Object[]{});
+        Object j = null;
+        
+        if (objecttype.equalsIgnoreCase("business")) {
+            try {
+                StringReader sr = new StringReader(xml.trim());
+                j = (BusinessEntity) JAXB.unmarshal(sr, BusinessEntity.class);
+            } catch (Exception ex) {
+            }
+        }
+        if (objecttype.equalsIgnoreCase("service")) {
+            try {
+                StringReader sr = new StringReader(xml.trim());
+                j = (BusinessService) JAXB.unmarshal(sr, 
BusinessService.class);
+            } catch (Exception ex) {
+            }
+        }
+        if (objecttype.equalsIgnoreCase("binding")) {
+            try {
+                StringReader sr = new StringReader(xml.trim());
+                j = (BindingTemplate) JAXB.unmarshal(sr, 
BindingTemplate.class);
+            } catch (Exception ex) {
+            }
+        }
+        if (objecttype.equalsIgnoreCase("tmodel")) {
+            try {
+                StringReader sr = new StringReader(xml.trim());
+                j = (TModel) JAXB.unmarshal(sr, TModel.class);
+            } catch (Exception ex) {
+            }
+        }
+
+
+        if (j != null) {
+            try {
+                //sign it
+                org.apache.juddi.v3.client.cryptor.DigSigUtil ds = new 
DigSigUtil();
+                if (isIncludePublicKey.isSelected()) {
+                    ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, 
"true");
+                }
+                if (isIncludeSubjectName.isSelected()) {
+                    
ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, "true");
+                }
+                if (isIncludeIssuer.isSelected()) {
+                    ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, 
"true");
+                }
+                ds.put(DigSigUtil.SIGNATURE_METHOD, 
jTextFieldSigMethod.getText());
+                ds.put(DigSigUtil.SIGNATURE_OPTION_DIGEST_METHOD, 
jTextFieldDigestMethod.getText());
+                ds.put(DigSigUtil.CANONICALIZATIONMETHOD, 
jTextFieldc14n.getText());
+                
+                PrivateKey key = (PrivateKey) keyStore.getKey((String) 
jList1.getSelectedValue(), null);
+                Certificate publickey = keyStore.getCertificate((String) 
jList1.getSelectedValue());
+
+                j = ds.signUddiEntity(j, publickey, key);
+                ds.clear();
+                StringWriter sw = new StringWriter();
+                JAXB.marshal(j, sw);
+                signedXml = sw.toString();
+            } catch (Exception ex) {
+                
Logger.getLogger(XmlSignatureApplet.class.getName()).log(Level.SEVERE, null, 
ex);
+                signedXml = "Sorry I couldn't sign the data. " + 
ex.getMessage();
+            }
+        } else {
+            signedXml = "Unable to determine which type of object that we're 
signing";
+        }
+
+
+        /*
+         try {
+         signedXml = this.sign(xml);
+         } catch (Exception ex) {
+         signedXml = ex.getMessage();
+         Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, 
ex);
+         }*/
+
+        //write it back to the web page
+        window.call("writeXml", new Object[]{signedXml});
+    }//GEN-LAST:event_jButton1ActionPerformed
+
+    private void 
jTextFieldDigestMethodActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_jTextFieldDigestMethodActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_jTextFieldDigestMethodActionPerformed
+
+    private void jTextFieldc14nActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_jTextFieldc14nActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_jTextFieldc14nActionPerformed
+    /**
+     * XML digital signature namespace
+     */
+    public final static String XML_DIGSIG_NS = 
"http://www.w3.org/2000/09/xmldsig#";;
+
+    private void signDOM(Node node, PrivateKey privateKey, Certificate 
origCert) {
+        XMLSignatureFactory fac = initXMLSigFactory();
+        X509Certificate cert = (X509Certificate) origCert;
+        // Create the KeyInfo containing the X509Data.
+        KeyInfoFactory kif = fac.getKeyInfoFactory();
+        List<Object> x509Content = new ArrayList<Object>();
+        //x509Content.add(cert.getSubjectX500Principal().getName());
+        x509Content.add(cert);
+        X509Data xd = kif.newX509Data(x509Content);
+        KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));
+
+        // Create a DOMSignContext and specify the RSA PrivateKey and
+        // location of the resulting XMLSignature's parent element.
+        DOMSignContext dsc = new DOMSignContext(privateKey, node);
+        dsc.putNamespacePrefix(XML_DIGSIG_NS, "ns2");
+
+        // Create the XMLSignature, but don't sign it yet.
+        try {
+            SignedInfo si = initSignedInfo(fac);
+            XMLSignature signature = fac.newXMLSignature(si, ki);
+
+            // Marshal, generate, and sign the enveloped signature.
+            signature.sign(dsc);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.ButtonGroup buttonGroup1;
+    private javax.swing.JCheckBox isIncludeIssuer;
+    private javax.swing.JCheckBox isIncludePublicKey;
+    private javax.swing.JCheckBox isIncludeSubjectName;
+    private javax.swing.JButton jButton1;
+    private javax.swing.JButton jButton2;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel2;
+    private javax.swing.JLabel jLabel3;
+    private javax.swing.JLabel jLabel4;
+    private javax.swing.JList jList1;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JPanel jPanel2;
+    private javax.swing.JPanel jPanel3;
+    private javax.swing.JPanel jPanel4;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JScrollPane jScrollPane2;
+    private javax.swing.JTabbedPane jTabbedPane1;
+    private javax.swing.JTextArea jTextArea1;
+    private javax.swing.JTextField jTextFieldDigestMethod;
+    private javax.swing.JTextField jTextFieldSigMethod;
+    private javax.swing.JTextField jTextFieldc14n;
+    // End of variables declaration//GEN-END:variables
+}

Modified: 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSignatureApplet.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSignatureApplet.java?rev=1543695&r1=1543694&r2=1543695&view=diff
==============================================================================
--- 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSignatureApplet.java
 (original)
+++ 
juddi/trunk/juddi-gui-dsig/src/main/java/org/apache/juddi/gui/dsig/XmlSignatureApplet.java
 Wed Nov 20 02:28:31 2013
@@ -308,20 +308,24 @@ public class XmlSignatureApplet extends 
     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) 
{//GEN-FIRST:event_jButton1ActionPerformed
         // TODO add your handling code here:
         String signedXml = "error!";
+        JSObject window = JSObject.getWindow(this);
         try {
             if (keyStore == null || keyStore.size() == 0) {
                 signedXml = "Unforunately, it looks as if you don't have any 
certificates to choose from.";
+                window.call("writeXml", new Object[]{signedXml});
                 return;
             }
         } catch (Exception ex) {
             signedXml = "Unforunately, it looks as if you don't have any 
certificates to choose from.";
+            window.call("writeXml", new Object[]{signedXml});
             return;
         }
         if (jList1.getSelectedValue() == null) {
             signedXml = "You must pick a certificate first";
+            window.call("writeXml", new Object[]{signedXml});
             return;
         }
-        JSObject window = JSObject.getWindow(this);
+        
         Object object2 = window.call("getBrowserName", null);
         Object object1 = window.call("getOsName", null);
         Object object3 = window.call("getObjectType", null);
@@ -363,7 +367,8 @@ public class XmlSignatureApplet extends 
             try {
                 //sign it
                 org.apache.juddi.v3.client.cryptor.DigSigUtil ds = new 
DigSigUtil();
-                ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, "t");
+                ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, 
"true");
+                ds.put(DigSigUtil.SIGNATURE_METHOD, "RSA_SHA1");
                 PrivateKey key = (PrivateKey) keyStore.getKey((String) 
jList1.getSelectedValue(), null);
 
                 Certificate publickey = keyStore.getCertificate((String) 
jList1.getSelectedValue());

Modified: juddi/trunk/juddi-gui/src/main/webapp/signer.jsp
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-gui/src/main/webapp/signer.jsp?rev=1543695&r1=1543694&r2=1543695&view=diff
==============================================================================
--- juddi/trunk/juddi-gui/src/main/webapp/signer.jsp (original)
+++ juddi/trunk/juddi-gui/src/main/webapp/signer.jsp Wed Nov 20 02:28:31 2013
@@ -30,7 +30,7 @@
             You're about to digitally sign the 
<b><%=StringEscapeUtils.escapeHtml(itemtype)%></b> identified by the key 
<b><%=StringEscapeUtils.escapeHtml(id)%></b>.<br>
             By electronically signing this UDDI entry, other users will then 
be able to verify that this entry hasn't been modified.<br>
 
-            <applet code="org.apache.juddi.gui.dsig.XmlSignatureApplet" 
archive="applets/juddi-gui-dsig-all.jar" MAYSCRIPT></applet> 
+            <applet code="org.apache.juddi.gui.dsig.XmlSigApplet2" 
archive="applets/juddi-gui-dsig-all.jar" MAYSCRIPT></applet> 
             <script type="text/javascript">
                 $.get("ajax/toXML.jsp?id=<%=id%>&type=<%=itemtype%>", 
function(data){
                     $("#data").val(data);



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to