|
Java example source code file (signature.xml)
The signature.xml Java example source code<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Envelope [ <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'> <!ENTITY c14n 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'> <!ENTITY xpath 'http://www.w3.org/TR/1999/REC-xpath-19991116'> <!ENTITY xslt 'http://www.w3.org/TR/1999/REC-xslt-19991116'> <!ATTLIST Notaries Id ID #IMPLIED> ]> <!-- Preamble --> <Envelope xmlns:foo="http://example.org/foo" xmlns="http://example.org/usps"> <DearSir>foo <Body>bar |
<YoursSincerely>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
<Reference URI="http://www.w3.org/TR/xml-stylesheet">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=
</Reference>
<Reference URI="http://www.w3.org/Signature/2002/04/xml-stylesheet.b64">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-1">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
<XPath>
self::text()
</XPath>
</Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
<XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
ancestor-or-self::dsig:SignedInfo
and
count(ancestor-or-self::dsig:Reference |
here()/ancestor::dsig:Reference[1]) >
count(ancestor-or-self::dsig:Reference)
or
count(ancestor-or-self::node() |
id('notaries')) =
count(ancestor-or-self::node())
</XPath>
</Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>tQiE3GUKiBenPyp3J0Ei6rJMFv4=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-2">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>zyjp8GJOX69990Kkqw8ioPXGExk=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest-1">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>qg4HFwsN+/WX32uH85WlJU9l45k=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#signature-properties-1">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>ETlEI3y7hvvAtMe9wQSz7LhbHEE=
</Reference>
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>J/O0HhdaPXxx49fgGWMESL09GpA=
</Reference>
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>J/O0HhdaPXxx49fgGWMESL09GpA=
</Reference>
<Reference URI="#xpointer(/)">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>J/O0HhdaPXxx49fgGWMESL09GpA=
</Reference>
<Reference URI="#xpointer(/)">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>MkL9CX8yeABBth1RChyPx58Ls8w=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>yamSIokKmjA3hB/s3Fu07wDO3vM=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>yamSIokKmjA3hB/s3Fu07wDO3vM=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>yamSIokKmjA3hB/s3Fu07wDO3vM=
</Reference>
<Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>419CYgyTWOTGYGBhzieWklNf7Bk=
</Reference>
<Reference URI="#reference-2">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>VzK45P9Ksjqq5oXlKQpkGgB2CNY=
</Reference>
<Reference Id="reference-1" URI="#manifest-reference-1">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>7/9fR+NIDz9owc1Lfsxu1JBr8uo=
</Reference>
<Reference Id="reference-2" URI="#reference-1">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>qURlo3LSq4TWQtygBZJ0iXQ9E14=
</Reference>
</SignedInfo>
<SignatureValue>
WvZUJAJ/3QNqzQvwne2vvy7U5Pck8ZZ5UTa6pIwR7GE+PoGi6A1kyw==
</SignatureValue>
<KeyInfo>
<RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#X509Data" URI="#object-4">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
<XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
ancestor-or-self::dsig:X509Data
</XPath>
</Transform>
</Transforms>
</RetrievalMethod>
</KeyInfo>
<Object Id="object-1" MimeType="text/plain">I am the text.
<Object Encoding="http://www.w3.org/2000/09/xmldsig#base64" Id="object-2" MimeType="text/plain">SSBhbSB0aGUgdGV4dC4=
<Object Id="object-3">
<NonCommentandus xmlns="">
</Object>
<Object>
<Manifest Id="manifest-1">
<Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=
</Reference>
<Reference URI="#reference-1">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>qURlo3LSq4TWQtygBZJ0iXQ9E14=
</Reference>
<Reference URI="#notaries">
<Transforms>
<Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
<xsl:output encoding="UTF-8" indent="no" method="xml" />
<xsl:template match="/">
<html>
<head>
<title>Notaries
</head>
<body>
<table>
<xsl:for-each select="Notaries/Notary">
<tr>
<th>
<xsl:value-of select="@name" />
</th>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
</Transform>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>c7wq5XKos6RqNVJyFy7/fl6+sAs=
</Reference>
</Manifest>
</Object>
<Object>
<SignatureProperties Id="signature-properties-1">
<SignatureProperty Target="#signature">
<SignerAddress xmlns="urn:demo">
Here is a short list of links related to this Java signature.xml source code file:
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.