DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40404>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40404





------- Additional Comments From [EMAIL PROTECTED]  2006-09-04 16:55 -------
Sure,

Edit the
src_samples/org/apache/xml/security/samples/signature/CreateSignature.java file
in the Java 1.3 zip like so:

      {
         //Add in the KeyInfo for the certificate that we used the private key 
of
         X509Certificate cert =
            (X509Certificate) ks.getCertificate(certificateAlias);

         sig.addKeyInfo(cert);
         sig.addKeyInfo(cert.getPublicKey());
         // Add these three lines
         org.apache.xml.security.keys.KeyInfo ki = sig.getKeyInfo();
         ki.itemX509Data(0).addSubjectName(cert.getSubjectDN().toString());
         ki.itemX509Data(0).addIssuerSerial(cert.getIssuerDN().toString(),
cert.getSerialNumber());

         System.out.println("Start signing");
         sig.sign(privateKey);
         System.out.println("Finished signing");
      }


The output signature.xml looks like this (notice, no subject or issuerserial):

<!-- Comment before -->
<apache:RootElement xmlns:apache="http://www.apache.org/ns/#app1";
xmlns:foo="http://example.org/#foo"; attr1="test1" attr2="test2" foo:attr1="foo's
test">Some simple text
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#";>
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315";></CanonicalizationMethod>
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1";></SignatureMethod>
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature";></Transform>
<Transform
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";></Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1";></DigestMethod>
<DigestValue>f+pDsT3LzyKV9Sg6rdK5bBrQlbo=</DigestValue>
</Reference>
<Reference URI="http://www.w3.org/TR/xml-stylesheet";>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1";></DigestMethod>
<DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
</Reference>
<Reference URI="http://www.nue.et-inf.uni-siegen.de/index.html";>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1";></DigestMethod>
<DigestValue>Hpg+6h1k1jYY5yr3TRzDZzw23CQ=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>YXvZhrrzY6C0v0KS7/KFnSzWo7FKFCH2+6Ie98DwUj8Cv3Jt8tJYFg==</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>
MIIC9jCCArQCBDruqiowCwYHKoZIzjgEAwUAMGExCzAJBgNVBAYTAkRFMR0wGwYDVQQKExRVbml2
ZXJzaXR5IG9mIFNpZWdlbjEQMA4GA1UECxMHRkIxMk5VRTEhMB8GA1UEAxMYQ2hyaXN0aWFuIEdl
dWVyLVBvbGxtYW5uMB4XDTAxMDUwMTEyMjA1OFoXDTA2MTAyMjEyMjA1OFowYTELMAkGA1UEBhMC
REUxHTAbBgNVBAoTFFVuaXZlcnNpdHkgb2YgU2llZ2VuMRAwDgYDVQQLEwdGQjEyTlVFMSEwHwYD
VQQDExhDaHJpc3RpYW4gR2V1ZXItUG9sbG1hbm4wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9T
gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9sVQQDExhDaHJpc3
gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv
8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX
Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSu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=
</Y>
</DSAKeyValue>
</KeyValue>
</KeyInfo>
</Signature></apache:RootElement>
ubVWzXgTuAHTRv

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to