<?xml version='1.0' encoding='utf-8'?>
<!-- 
	For use when a committee document points at the OASIS web site for publishing:
	<?xml-stylesheet type="text/xsl" 
	href="http://docs.oasis-open.org/templates/DocBook/spec-0.6/stylesheets/oasis-specification-html.xsl"?>
	<!DOCTYPE article
	PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
	"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" 
	
	For use when a committee document points to an embedded installation of DocBook
	(note the instructions for embedding DocBook requires pruning some directories
	and adjusting the stylesheet and DocBook directories in these declarations):
	<?xml-stylesheet type="text/xsl" 
	href="../htmlruntime/spec-0.6/stylesheets/oasis-specification-html.xsl"?>
	<!DOCTYPE article
	PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
	"../htmlruntime/spec-0.6/docbook/docbookx.dtd" 
	
	For use when a committee document is published in a local environment only
	(note the instructions for local publishing require adjusting the stylesheet
	and DocBook directories in these declarations):
	<?xml-stylesheet type="text/xsl" 
	href="file:///z:/oasis/spec-0.6/stylesheets/oasis-specification-html-offline.xsl"?>
	<!DOCTYPE article
	PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
	"file:///z:/oasis/spec-0.6/docbook/docbookx.dtd" 
-->
<?xml-stylesheet type="text/xsl" 
	href="../htmlruntime/spec-0.6/stylesheets/oasis-specification-html.xsl"?>
<!DOCTYPE article
	PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
	"../htmlruntime/spec-0.6/docbook/docbookx.dtd"
[
<!--the document properties-->
<!ENTITY name "localsig-v1.0">
<!ENTITY pversion "1.0">
<!ENTITY version "1.0">
<!ENTITY stage "01">
<!ENTITY wpname "csd">
<!ENTITY standard "Committee Specification Draft 01">
<!ENTITY this-loc "http://docs.oasis-open.org/dss-x/localsig/v1.0/csd01">
<!ENTITY previous-loc "http://docs.oasis-open.org/dss-x/localsig/v1.0/csd01">
<!ENTITY latest-loc "http://docs.oasis-open.org/dss-x/localsig/v1.0">
<!ENTITY pubdate "16 January 2014">
]>
<article status="&standard;">
	<articleinfo>
		<title>DSS Extension for Local Signature Computation Version 1.0 </title>
		<releaseinfo role="cvs"> $Id: spectools-docbook-template-wd07.xml,v 1.7 2012/06/14 01:54:35 admin Exp $ </releaseinfo>
		<productname>&name;</productname>
		<productnumber>&wpname;&stage;</productnumber>
		<releaseinfo role="track">Standards Track Work Product</releaseinfo>
		
		<releaseinfo role="OASIS-specification-this-authoritative"
			>&this-loc;/&name;-&wpname;&stage;.html</releaseinfo>
		<releaseinfo role="OASIS-specification-this"
			>&this-loc;/&name;-&wpname;&stage;.pdf</releaseinfo>
		<releaseinfo role="OASIS-specification-this"
			>&this-loc;/&name;-&wpname;&stage;.xml</releaseinfo>
		
		<!--
		<releaseinfo role="OASIS-specification-previous"
			>&previous-loc;/&name;.html</releaseinfo>
		<releaseinfo role="OASIS-specification-previous"
			>&previous-loc;/&name;.pdf</releaseinfo
		<releaseinfo role="OASIS-specification-previous"
			>&previous-loc;/&name;.xml</releaseinfo>
		-->
		
		<releaseinfo role="OASIS-specification-latest-authoritative"
			>&latest-loc;/&name;.html</releaseinfo>
		<releaseinfo role="OASIS-specification-latest"
			>&latest-loc;/&name;.pdf</releaseinfo>
		<releaseinfo role="OASIS-specification-latest"
			>&latest-loc;/&name;.xml</releaseinfo>
		<releaseinfo role="committee">
			<ulink url="https://www.oasis-open.org/committees/dss-x/">OASIS Digital Signature Services
				eXtended (DSS-X) TC </ulink>
		</releaseinfo>
		<authorgroup>
			<editor>
				<firstname>Ernst Jan</firstname>
				<surname>van Nigtevecht</surname>
				<affiliation>
					<orgname><ulink url="http://www.sonnenglanz.net">Sonnenglanz Consulting BV</ulink></orgname>
				</affiliation>
				<email>ejvn@sonnenglanz.net</email>
			</editor>
			<editor>
				<firstname>Frank</firstname>
				<surname>Cornelis</surname>
				<affiliation>
					<orgname><ulink url="http://www.fedict.belgium.be/nl/">FedICT</ulink></orgname>
				</affiliation>
				<email>frank.cornelis@fedict.be</email>
			</editor>
			<othercredit>
				<firstname>Juan Carlos</firstname>
				<surname>Cruellas</surname>
				<affiliation>
					<orgname><ulink url="http://www.ac.upc.edu/">UPC-DAC</ulink></orgname>
				</affiliation>
				<email>cruellas@ac.upc.edu</email>
			</othercredit>
			<othercredit>
				<firstname>Stefan</firstname>
				<surname>Drees</surname>
				<affiliation>
					<orgname>Individual</orgname>
				</affiliation>
				<email>stefan@drees.name</email>
			</othercredit>
		</authorgroup>
		<pubdate>&pubdate;</pubdate>
		<copyright>
			<year>2014</year>
			<holder>OASIS Open. All Rights Reserved.</holder>
		</copyright>
		<legalnotice role="additional">
			<title>Additional artifacts</title>
			<para>This prose specification is one component of a Work Product that also includes:</para>
			<itemizedlist spacing="compact">
				<listitem>
					<para>XML schemas: <ulink url="http://docs.oasis-open.org/dss-x/localsig/v1.0/csd01/schemas/">http://docs.oasis-open.org/dss-x/localsig/v1.0/csd01/schemas/</ulink></para>
				</listitem>
			</itemizedlist>
		</legalnotice>
		<legalnotice role="related">
			<title>Related work</title>
			<para>This specification is related to:</para>
			<itemizedlist spacing="compact">
				<listitem>
					<para><emphasis>Digital Signature Service Core Protocols, Elements, and Bindings Version 1.0</emphasis>. 11 April 2007. OASIS Standard. 
						<ulink url="http://docs.oasis-open.org/dss/v1.0/oasis-dss-core-spec-v1.0-os.html">http://docs.oasis-open.org/dss/v1.0/oasis-dss-core-spec-v1.0-os.html</ulink>.
					</para>
				</listitem>
			</itemizedlist>
		</legalnotice>
		<legalnotice role="namespaces">
			<title>Declared XML Namespaces</title>
			<para>
				<ulink url="http://docs.oasis-open.org/dss-x/ns/localsig"
					>http://docs.oasis-open.org/dss-x/ns/localsig</ulink>
			</para>
		</legalnotice>
		<abstract>
			<para> The core OASIS Digital Signature Service webservice <xref linkend="dssCore"/> supports the creation of signatures
				on behalf of applications and / or users by utilizing server-based signature keys.
			</para>
			<para>	This <emphasis>Local Signature Computation</emphasis> profile extends the core functionality such that end users can bring (use) their own (secure) signature-creation device. 
				Examples of such devices are smartcards or usb-tokens but also smartphones, mobile phones, tablets, pc's or laptops with privately held signature keys.
			</para>
			<para> Three solutions are presented to support the varying capabilities of applications and different use cases.  
				The first solution is useful for web-applications where web browsers can access the (secure) signature-creation device that is available at the desktop (e.g. a smartcard connected via USB).
				The second solution is useful for applications that can access the (secure) signature-creation device themselve, for instance desktop applications or smartphone apps.
				The third solution is useful for any application where the  (secure) signature-creation device can only be accessed via a separate channel, for instance a mobile device, through a third-party.
			</para>
		</abstract>
		<legalnotice role="status">
			<title>Status</title>			
			<para>This document was last revised or approved by the OASIS Digital Signature Services 
				eXtended (DSS-X) TC on the above date. The level of approval is also
				listed above. Check the "Latest version" location noted above for
				possible later revisions of this document.
			</para>
			<para>Technical Committee members should send comments on this
				specification to the Technical Committee's email list. Others should
				send comments to the Technical Committee by using the "<ulink
					url="http://www.oasis-open.org/committees/comments/index.php?wg_abbrev=dss-x"
					>Send A Comment</ulink>" button on the Technical Committee's web page
				at <ulink url="http://www.oasis-open.org/committees/dss-x/"
					>http://www.oasis-open.org/committees/dss-x/</ulink>.
			</para>
			<para>For information on whether any patents have been disclosed that may
				be essential to implementing this specification, and any offers of
				patent licensing terms, please refer to the Intellectual Property
				Rights section of the Technical Committee web page (<ulink
					url="http://www.oasis-open.org/committees/dss-x/ipr.php"
					>http://www.oasis-open.org/committees/dss-x/ipr.php</ulink>).
			</para>
		</legalnotice>
		<legalnotice role="citation">
			<title>Citation format</title>
			<para>When referencing this specification the following citation format
				should be used:</para>
			<para>
				<bibliolist>
					<bibliomixed>
						<abbrev>&name;</abbrev>
						<title><emphasis>DSS Extension for Local Signature Computation Version 1.0</emphasis>.</title>
						<personname><othername>Edited by Ernst Jan van Nigtevecht and Frank Cornelis.</othername></personname>
						<date>&pubdate;.</date>
						<releaseinfo>OASIS Committee Specification Draft &stage;.</releaseinfo>
						<citetitle><ulink url="&this-loc;/&name;-&wpname;&stage;.html"
							>&this-loc;/&name;-&wpname;&stage;.html</ulink>.</citetitle> Latest version: <citetitle><ulink url="&latest-loc;/&name;.html"
								>&latest-loc;/&name;.html</ulink>.</citetitle>
					</bibliomixed>
				</bibliolist>
			</para>
		</legalnotice>
		<legalnotice role="notices">
			<title>Notices</title>
			<para>Copyright &#169; OASIS Open 2014. All Rights Reserved.</para>
			<para>All capitalized terms in the following text have the meanings
				assigned to them in the OASIS Intellectual Property Rights Policy (the
				"OASIS IPR Policy"). The full Policy may be found at <ulink  
					url="http://www.oasis-open.org/who/intellectualproperty.php"
					>http://www.oasis-open.org/who/intellectualproperty.php</ulink>.</para>
			<para>This document and translations of it may be copied and furnished to
				others, and derivative works that comment on or otherwise explain it or
				assist in its implementation may be prepared, copied, published, and
				distributed, in whole or in part, without restriction of any kind,
				provided that the above copyright notice and this section are included
				on all such copies and derivative works. However, this document itself
				may not be modified in any way, including by removing the copyright
				notice or references to OASIS, except as needed for the purpose of
				developing any document or deliverable produced by an OASIS Technical
				Committee (in which case the rules applicable to copyrights, as set
				forth in the OASIS IPR Policy, must be followed) or as required to
				translate it into languages other than English.</para>
			<para>The limited permissions granted above are perpetual and will not be
				revoked by OASIS or its successors or assigns.</para>
			<para>This document and the information contained herein is provided on
				an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR
				IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
				INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY
				IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
				PURPOSE.</para>
			<para>OASIS requests that any OASIS Party or any other party that
				believes it has patent claims that would necessarily be infringed by
				implementations of this OASIS Committee Specification or OASIS
				Standard, to notify OASIS TC Administrator and provide an indication of
				its willingness to grant patent licenses to such patent claims in a
				manner consistent with the IPR Mode of the OASIS Technical Committee
				that produced this specification.</para>
			<para>OASIS invites any party to contact the OASIS TC Administrator if it
				is aware of a claim of ownership of any patent claims that would
				necessarily be infringed by implementations of this specification by a
				patent holder that is not willing to provide a license to such patent
				claims in a manner consistent with the IPR Mode of the OASIS Technical
				Committee that produced this specification. OASIS may include such
				claims on its website, but disclaims any obligation to do so.</para>
			<para>OASIS takes no position regarding the validity or scope of any
				intellectual property or other rights that might be claimed to pertain
				to the implementation or use of the technology described in this
				document or the extent to which any license under such rights might or
				might not be available; neither does it represent that it has made any
				effort to identify any such rights. Information on OASIS' procedures
				with respect to rights in any document or deliverable produced by an
				OASIS Technical Committee can be found on the OASIS website. Copies of
				claims of rights made available for publication and any assurances of
				licenses to be made available, or the result of an attempt made to
				obtain a general license or permission for the use of such proprietary
				rights by implementers or users of this OASIS Committee Specification
				or OASIS Standard, can be obtained from the OASIS TC Administrator.
				OASIS makes no representation that any information or list of
				intellectual property rights will at any time be complete, or that any
				claims in such list are, in fact, Essential Claims.</para>
			<para>The name "OASIS" is a trademark of <ulink
				url="http://www.oasis-open.org">OASIS</ulink>, the owner and
				developer of this specification, and should be used only to refer to
				the organization and its official outputs. OASIS welcomes reference to,
				and implementation and use of, specifications, while reserving the
				right to enforce its marks against misleading uses. Please see <ulink
					url="http://www.oasis-open.org/who/trademark.php"
					>http://www.oasis-open.org/who/trademark.php</ulink> for above
				guidance.</para>
		</legalnotice>
	</articleinfo>
	<section>
		<title>Introduction</title>
		<para> The OASIS Digital Signature Services specification <xref linkend="dssCore"/> standardizes a protocol by which (i) a client can send documents (or document digests) to a
			server and receive back a signature on the documents, or by which (ii) a client can send documents (or document digests) and a signature to a server, 
			and receive back an answer on whether the signature verifies the documents.</para>
		<para> These operations could be useful in a variety of 
			contexts, for example they could allow clients to access a single corporate key for signing press releases, with centralized access control, 
			auditing, and archiving of signature requests. They could also allow clients to create signatures without needing complex client software and configuration.</para>
		<para> This profile extends the OASIS DSS protocol such that a (secure) signature-creation device (an SSCD or SCD), under the direct control of the user,
			is used for the actual computation of the digital signature value. 
			The (secure) signature-creation device is not 
			part of, nor located at, the server that implements the DSS protocol.
		</para>
		<para>The (secure) signature-creation device may have limited software and performance capabilities and hence may be supported by a OASIS DSS compliant service to handle the complexities
			of the (secure) signature-creation and document manipulation.
		</para>
		<section>
			<title>Terminology</title>
			<para> 
				The key words <glossterm>MUST</glossterm>, <glossterm>MUST NOT</glossterm>,
					<glossterm>REQUIRED</glossterm>, <glossterm>SHALL</glossterm>,
					<glossterm>SHALL NOT</glossterm>, <glossterm>SHOULD</glossterm>,
					<glossterm>SHOULD NOT</glossterm>, <glossterm>RECOMMENDED</glossterm>,
					<glossterm>MAY</glossterm>, and <glossterm>OPTIONAL</glossterm> are to be
				interpreted as described in <xref linkend="rfc2119"/>. 
			</para>
			<para> 
				These keywords are capitalized when used to unambiguously specify requirements
				over protocol features and behavior that affect the interoperability and security of
				implementations. When these words are not capitalized, they are meant in their
				natural-language sense. 
			</para>
			<para> 
				This specification uses the following typographical conventions in text:
					<code>&lt;ns:Element&gt;</code>, <code>Attribute</code>,
					<command>Datatype</command>, <code>OtherCode</code>. 
			</para>
			<para>
				An <command>input document</command> that has to be signed can be any piece of data that can be used as input to a signature 
				calculation, according to the <xref linkend="dssCore"/> specification. 
				Such a document can even be a signature (for example, a pre-existing signature can be counter-signed) or timestamp.
			</para>
			<para>
				A <command>digital signature value</command> is a basic form of a signature, usually in the form of a PKCS#1 format (<xref linkend="PKCS1_V21"/> or <xref linkend="PKCS1_V22" />).
				The digital signature value is computed by the (secure) signature-creation device for a given digest. The validity of the corresponding certificate is not checked by the device.
			</para>
			<para>
				An <command>electronic signature</command> is an enriched digital signature value and can include for instance
				a time-stamp (to specify the time of signing) and/or revocation information (to specify the validity of the corresponding certificate and trusted roots and/or intermediate certificates).
				Additionally, the electronic signature will only be created by the Digital Signature Service if the corresponding certificate is valid (not revoked).
			</para>
		</section>
		<section>
			<title>Abbreviations</title>
			<para>
				<itemizedlist spacing="compact">
					<listitem>
						<para>
							<emphasis>SCD</emphasis>: Signature-Creation Device. A device that is capable of creating a digital signature value using a private key that is stored in the device.
						</para>
					</listitem>
					<listitem>
						<para>
							<emphasis>SSCD</emphasis>: Secure Signature-Creation Device. 
							A signature-creation device which meets the requirements laid down in Annex III of the European 
							Directive 1999/93/EC of the European Parliament and the Council of 13 December 1999 on a
							Community framework for electronic signatures <xref linkend="SSCD"/>.
						</para>
					</listitem>
					<listitem>
						<para>
							<emphasis>LSCD</emphasis>: Local Signature-Creation Device. A (secure) signature-creation device that is owned by and in the proximity of an end user.
						</para>
					</listitem>
					<listitem>
						<para>
							<emphasis>RSCD</emphasis>: Remote Signature-Creation Device.  A (secure) signature-creation device that is owned by, but not in the proximity of, an end user. 
							Nonetheless, the usage of the device is (by some other means) under the control of the end user. 
						</para>
					</listitem>
					<listitem>
						<para>
							<emphasis>Client</emphasis>: A requester of a particular resource or service that is provided by a server.
						</para>
					</listitem>
					<listitem>
						<para>
							<emphasis>Server</emphasis>: A provider of a resource or service that is used by a client.
						</para>
					</listitem>
					<!--
					<listitem>
						<para>
							<emphasis>RP</emphasis>:  Relying Party. An entity on the Internet that uses an identity provider to authenticate a user.
						</para>
					</listitem>
					-->
				</itemizedlist>
			</para>
		</section>
		
		<section>
			<title>Normative References</title>
			<bibliolist>
				<bibliomixed id="dssCore"><abbrev>DSSCore</abbrev> S. Drees et al., <title>Digital
						Signature Service Core Protocols and Elements</title>, OASIS, April 2007, <citetitle><ulink
							url="http://docs.oasis-open.org/dss/v1.0/oasis-dss-core-spec-v1.0-os.pdf"
							/>
						</citetitle>
				</bibliomixed>
				<!--
				<bibliomixed id="dssVerify"><abbrev>DSSVer</abbrev> D. H&uuml;hnlein et al.,
						<title>Profile for Comprehensive Multi-Signature Verification Reports
						Version 1.0</title>, OASIS, November 2010, <citetitle><ulink
							url="http://docs.oasis-open.org/dss-x/profiles/verificationreport/oasis-dssx-1.0-profiles-vr-cs01.pdf"
							/>
						</citetitle>
				</bibliomixed>
				-->
				<bibliomixed id="Excl-C14N"><abbrev>Excl-C14N</abbrev> J. Boyer et al.,
						<title>Exclusive XML Canonicalization Version 1.0</title>, World Wide Web
					Consortium, July 2002, <citetitle><ulink url="http://www.w3.org/TR/xml-exc-c14n/"
							/>
					</citetitle>
				</bibliomixed>
				<bibliomixed id="HTML401"><abbrev>HTML401</abbrev> D. Raggett et al., <title>HTML
						4.01 Specification</title>, World Wide Web Consortium, December 1999, <citetitle><ulink url="http://www.w3.org/TR/html4"/>
						</citetitle>
				</bibliomixed>
				<bibliomixed id="rfc2119"><abbrev>RFC 2119</abbrev> S. Bradner, <title>Key words for
						use in RFCs to Indicate Requirement Levels</title>, <citetitle><ulink url="http://www.ietf.org/rfc/rfc2119.txt"
							/>
						</citetitle> IETF (Internet Engineering Task Force) RFC 2119, March 1997. 
				</bibliomixed>
				<bibliomixed id="RFC2616"><abbrev>RFC 2616</abbrev> R. Fielding et al.,
						<title>Hypertext Transfer Protocol - HTTP/1.1</title>, 
					<citetitle><ulink url="http://www.ietf.org/rfc/rfc2616.txt"
							/>
						</citetitle> IETF (Internet Engineering Task Force) RFC 2616, June 1999. 
				</bibliomixed>
				<bibliomixed id="rfc3061"><abbrev>RFC 3061</abbrev> M. Mealling, 
					<title>A URN Namespace of Object Identifiers</title>, 
					<citetitle><ulink url="http://tools.ietf.org/rfc/rfc3061.txt"
				/>
				</citetitle> IETF (Internet Engineering Task Force), February 2001. 
				</bibliomixed>
				
				<bibliomixed id="samlCore"><abbrev>SAMLCore</abbrev> S. Cantor et al.,
						<title>Assertions and Protocols for the OASIS Security Assertion Markup
						Language (SAML) V2.0</title>, OASIS, March 2005, <citetitle><ulink
							url="http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf"
							/>
						</citetitle>
				</bibliomixed>
				<!--
				<bibliomixed id="ws-sc"><abbrev>WS-SecConv</abbrev> A. Nadalin et al.,
						<title>WS-SecureConversation 1.4</title>, OASIS, February 2009, <citetitle><ulink
							url="http://docs.oasis-open.org/ws-sx/ws-secureconversation/v1.4/ws-secureconversation.html"
							/>
						</citetitle>
				</bibliomixed>
				<bibliomixed id="ws-trust"><abbrev>WS-Trust</abbrev> A. Nadalin et al.,
						<title>WS-Trust 1.3</title>, OASIS, March 2007, <citetitle><ulink
							url="http://docs.oasis-open.org/ws-sx/ws-trust/200512/ws-trust-1.3-os.html"
							/>
						</citetitle>
				</bibliomixed>
				-->
				<bibliomixed id="XHTML"><abbrev>XHTML</abbrev><title>XHTML 1.0 The Extensible
						HyperText Markup Language (Second Edition)</title>, World Wide Web
					Consortium Recommendation, August 2002, <citetitle><ulink url="http://www.w3.org/TR/xhtml1/">http://www.w3.org/TR/xhtml1/
						</ulink>
					</citetitle>
				</bibliomixed>
				<bibliomixed id="xmldsig"><abbrev>XMLSig</abbrev> D. Eastlake et al.,
						<title>XML-Signature Syntax and Processing</title>, W3C Recommendation,
					June 2008, <citetitle><ulink url="http://www.w3.org/TR/xmldsig-core/"
							/>
					</citetitle>
				</bibliomixed>
				<bibliomixed id="xmlns"><abbrev>XML-ns</abbrev> T. Bray, D. Hollander, A. Layman,
						<title>Namespaces in XML</title>, W3C Recommendation, January 1999, <citetitle><ulink url="http://www.w3.org/TR/1999/REC-xml-names-19990114"
							/>
						</citetitle>
				</bibliomixed>
				<bibliomixed id="xmlschema"><abbrev>XML-Schema</abbrev>H. S. Thompson et al.,
					<title>XML Schema Part 1: Structures</title>, W3C Recommendation, May 2001, <citetitle><ulink url="http://www.w3.org/TR/xmlschema-1/"
					/>
					</citetitle>
				</bibliomixed>
				
			</bibliolist>
			
		</section>
		
		<section>
			<title>Non-Normative References</title>
			<bibliolist>
				<bibliomixed id="EuropeanCitizenCard"><abbrev>ECC</abbrev> CEN
					<title>CEN-TS 15480 / CEN/TC 224 - Personal identification, electronic signature and cards and their related systems and operations</title>
					<citetitle/>
				</bibliomixed>
				<bibliomixed id="ETSI-M-COMM"><abbrev>M-COMM</abbrev> ETSI
					<title>Mobile Commerce (M-COMM); Mobile Signatures; Business and Functional Requirements</title>, ETSI Technical Report 102 203 V1.1.1, May 2003
					<citetitle/>
				</bibliomixed>
				<bibliomixed id="SSCD">
					<abbrev>1999/93/EC</abbrev> <title>Directive 1999/93/EC of the European Parliament and the Council of 13 December 1999 on a Community framework for electronic signatures.</title>
					<citetitle><ulink url="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:31999L0093:en:HTML"/>
					</citetitle>
				</bibliomixed>
				<bibliomixed id="PKCS1_V21">
					<abbrev>PKCS#1 version 2.1</abbrev> <title>Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography
						Specifications</title> Version 2.1, IETF RFC 3447, February 2003.
					<citetitle><ulink url="http://tools.ietf.org/html/rfc3447"/>
					</citetitle>
				</bibliomixed>
				<bibliomixed id="PKCS1_V22">
					<abbrev>PKCS#1 version 2.2</abbrev> <title>PKCS#1 v2.2: RSA Cryptography Standard</title>, RSA Laboratories, October 27, 2012.
					<citetitle><ulink url="http://www.rsa.com/rsalabs/pkcs/files/h11300-wp-pkcs-1v2-2-rsa-cryptography-standard.pdf"/>
					</citetitle>
				</bibliomixed>
				<bibliomixed id="draft-larmouth-oid-iri-04"><abbrev>draft-larmouth-oid-iri-04</abbrev> J. Larmouth, <title>An IRI/URI Namespace for International Object Identifiers (OIDs)</title>, <citetitle><ulink url="http://tools.ietf.org/id/draft-larmouth-oid-iri-04.txt"
				/>
				</citetitle> IETF (Internet Engineering Task Force) DRAFT, July 24, 2005. 
				</bibliomixed>
				
			</bibliolist>
			
		</section>
		
		<section>
			<title>Namespaces</title>
			<para> The structures described in this specification are contained in the schema file
				which is part of <xref linkend="schema"/>. All schema listings in the current
				document are excerpts from the schema file. This schema is associated with the
				following XML namespace:
				<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig</code></programlisting></para>
			<para> Conventional XML namespace prefixes are used in this document: </para>
			<itemizedlist spacing="compact">
				<listitem>
					<para> The prefix <code>xs:</code>  stands for the W3C XML Schema namespace
						<xref linkend="xmlschema"/>.
					</para>
				</listitem>
				<listitem>
					<para> The prefix <code>ds:</code> stands for the W3C XML Signature namespace
						<xref linkend="xmldsig"/>.
					</para>
				</listitem>
				<listitem>
					<para> The prefix <code>dss:</code> stands for the OASIS DSS core namespace <xref
						linkend="dssCore"/>.
					</para>
				</listitem>
				<listitem>
					<para> The prefix <code>localsig:</code> stands for the OASIS DSS-X local signature profile namespace.
					</para>
				</listitem>
				<!-- 
				<listitem>
					<para> The prefix <code>vr:</code> stands for the Profile for Comprehensive
						Multi-Signature Verification Reports namespace <xref linkend="dssVerify"/>
					</para>
				</listitem>
				<listitem>
					<para> The prefix <code>wst:</code> stands for the WS-Trust namespace <xref
						linkend="ws-trust"/>
					</para>
				</listitem>
				-->
			</itemizedlist>
			<para> Applications MAY use different namespaces, and MAY use whatever namespace
				defaulting/scoping conventions they desire, as long as they are compliant with the
				Namespace in XML specification <xref linkend="xmlns"/>. </para>
		</section>

		<section id="requirements">
			<title>Requirements (Non-Normative)</title>
			<para>
				OASIS Digital Signature Service (DSS) protocol such that an electronic signature can be created by means of a (secure) signature-creation device under the direct control of an end user.
				This section lists the requirements for the local signature computation profile.
				<itemizedlist>
					<listitem><para>
						It shall be possible to use a (secure) signature-creation device (using protocols such as [ISO/IEC 7816], [ISO/IEC 24727] and [CEN 15480]) at a different location from the OASIS DSS server.
					</para></listitem>
					<listitem><para>
						It shall be possible to specify a digest method (algorithm) to be used in the (secure) signature-creation process.
					</para></listitem>
					<listitem><para>
						It shall be possible to obtain the digest for a given input documents (and document type) and given digest method (algorithm).
					</para></listitem>
				</itemizedlist>
			</para>
		</section>
		
		<section id="design-rationale">
			<title>Design Rationale (Non-Normative)</title>
			<section id="design-rationale-intro">
				<title>Introduction</title>
				<para> 
					The DSS protocol assumes a client-server relationship. 
					The client initiates a SignRequest (1) and the server creates the electronic signature for the input document (2, 3 and 4). 
					The resulting electronic signature (and whenever requested the document) is sent back to the client in the SignResponse (5). 
					This is shown in the figure below.
				</para>
				<figure id="fig-dss-client-server">
					<title>A client and server that implement the OASIS DSS protocol</title>
					<mediaobject>
						<imageobject>
							<imagedata  depth="170" align="center" width="500" 
								fileref="figure-1-dss-core.png" format="PNG"/>
						</imageobject>
					</mediaobject>
				</figure>
				<para> 
					Note that the signature-creation device (SCD) is (by default) part of the server that implements the OASIS DSS protocol.
				</para>
				
				<para>
					Such an architecture is applicable in case the end users do not own a signature-creation device (SCD). However, large-scale signing token deployments increase
					the use of (secure) signature-creation devices that are owned by and in the proximity of an end user. Examples are:
					<itemizedlist>
						<listitem>
							<para>National eID cards or European Citizen Card <xref linkend="EuropeanCitizenCard"/>, containing a secure signature-creation device (<xref linkend="SSCD"/>).
							</para>
						</listitem>
						<listitem>
							<para>Mobile devices, where the SIM card can be used as a secure signature-creation device (SSCD) <xref linkend="ETSI-M-COMM"/>.
							</para>
						</listitem>
					</itemizedlist>
					
					In such scenarios it is still interesting to keep a OASIS DSS in place for several reasons:
					<itemizedlist>
						<listitem>
							<para> Despite the fact that every person owns a token with signing capability,
								he/she might not have the appropriate software installed on the system for
								the creation of electronic signatures. It might be easier to maintain a
								lightweight solution, for instance by means of an applet, instead of a full blown token middleware that
								has to be installed on every participating client&apos;s system. The
								diversity among the client platforms is also easier to manage from a
								centralized service instead of distributing token middleware to all
								participating client systems. Furthermore, managing the configuration of the
								signature policy to be used for the creation of electronic signatures within
								a certain context might be easier using a centralized service.
							</para>
						</listitem>
						<listitem>
							<para> 
								Transforming a business workflow that is based on paper-documents into a digital equivalent,
								requires a sub-process for the creation (and validation) of electronic signatures on digital documents. Such a sub-process 
								should be available as a service that can be easily integrated with a business application. 
							</para>
						</listitem>
						<listitem>
							<para>
								From a technical point of view it might be easier to maintain different
								OASIS Digital Signature Services, each specialized in handling a specific signature and token types. E.g. tokens
								per vendor, or per country. 
							</para>
						</listitem>
					</itemizedlist> 
				</para>
				
				<para> This profile extends the OASIS DSS protocol such that end users can present their own (secure) signature-creation device. Consequently, the device itself is not 
					located at the server that implements the DSS protocol.
				</para>
				<para> 
					Although the (secure) signature-creation device is under the control of the end user, the location of the device can be local or remote. The following terminology is used:
					<itemizedlist>
						<listitem>
							<para>
								if the (secure) signature-creation device is in the proximity of the end user,
								it is referred to as a <emphasis>LOCAL</emphasis> (secure) signature-creation device, abbreviated to <emphasis>LSCD</emphasis>;
							</para>
						</listitem>
						<listitem>
							<para>
								if the (secure) signature-creation device is owned by the end user and stored at a remote site (still under the direct control of the end user, but
								not in the proximity of the end user), 
								it is referred to as a <emphasis>REMOTE</emphasis> (secure) signature-creation device, abbreviated to <emphasis>RSCD</emphasis>.
							</para>
						</listitem>
					</itemizedlist> 
				</para>
				<para>
					Note that from the viewpoint of the Digital Signature Service, both LSCD and RSCD have to be treated as remote devices.
				</para>
				<para>
					The following diagram visualizes the (logical) relationship between the LSCD (or RSCD) and the Digital Signature Service.
				</para>
				
				<figure id="fig-dss-extended1">
					<title>Local and remote device for signature creation</title>
					<mediaobject>
						<imageobject>
							<imagedata depth="200" align="center" width="600"  
								fileref="figure-2-dss-localsig.png" format="PNG"/>
						</imageobject>
					</mediaobject>
				</figure>
				
				<para>
					To re-use the existing DSS core protocol functionality as much as possible, the Digital Signature Service could delegate the computation of the digital signature value as depicted below. 
					It assumes that the LSCD or RSCD implements a basic DSS protocol to serve the sign requests of a digest; only the basic signature operations
					are assumed (no on-line certificate validation, timestamp requests, etcetera). 
				</para>
				
				<figure id="fig-dss-extended1b">
					<title>Delegation of the signature creation to the LSCD or RSCD</title>
					<mediaobject>
						<imageobject>
							<imagedata depth="200" align="center" width="600"  
								fileref="figure-3-dss-localsig.png" format="PNG"/>
						</imageobject>
					</mediaobject>
				</figure>
				
				<para>
					In general, the LSCD or RSCD may have limited software and performance capabilities and hence may be supported by a 
					OASIS DSS compliant service to handle the complexities of the (secure) signature-creation, electronic signature processing and document manipulation.
					Furthermore, in general, the LSCD or RSCD might not be accessible through a DSS core protocol.
				</para>
				<para>
					The LSCD or RSCD must at least be able to serve a request to sign a given digest. It is assumed that the interface to the actual (S)SCD is 
					accessed through one of the possible standards, such as the APDU (ISO 7816) or the IFD-Client (ISO/IEC 24727 / CEN 15480) standard. 
					It shows that the profile should not depend on the actual interface of the (S)SCD. 
					It is assumed that there will be some middleware that abstracts from the vendor-specific implementation of the (S)SCD. 
				</para>
				<para> 
					The introduction of an LSCD or RSCD can have different use cases, depending on the technology as well.
					For instance, is the LSCD integrated in a mobile device and is the DSS client running on different platform?
					Or is the LSCD connected to the DSS client?
					The next section present a number of use cases that are considered for this profile.
				</para>
				
			</section>
			
			<section id="usecases">
				<title>Use Cases</title>
				<para>
					The basic sequence within the use cases is as follows. A user initiates a signing action by means of a client application. 
					The client application initiates a SignRequest to the Digital Signature Service (1).
					The Digital Signature Service calculates the digest (2), obtains a digital signature value by some mechanism (3),
					creates the electronic signature from the digital signature value and processes it according to the request (4). 
					The resulting electronic signature (and whenever requested the document) is sent back to the client in the SignResponse (5). 
				</para>
				<section id="example1">
					<title>Use Case 1</title>
					<para>
						This use case assumes a thick or thin client platform. The (secure) signature-creation 
						device can be a smartcard connected to the client platform by means of a smartcard reader. 
						A web browser is used to let the end user access the web application. 
						The web application has implemented the DSS protocol. 
						To sign (a) document(s), the web application sends the document(s) to the 
						DSS server; the DSS server must obtain (somehow) the digital signature value computed by the smartcard. 
						Note that the DSS server cannot access the smartcard reader without additional mechanisms; proposals to solve this are presented in section <xref linkend="solutions"/>.
					</para> 
					<para>
						<figure id="fig-dss-localsigexample1">
							<title>A smartcard connected to a desktop</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="200" align="center" width="600" 
										fileref="figure-4-use-case-1.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
						
					</para>
				</section>
				<section id="example2">
					<title>Use Case 2</title>
					<para>
						This use case assumes the use of a mobile phone that contains a (secure) signature-creation device. The mobile phone is connected to the mobile operator infrastructure. 
						A web browser is used to let the end user access the client application. The client application has implemented the DSS protocol. 
						To sign (a) document(s), the client sends the document(s) to the DSS server; the DSS server must obtain the digital signature value computed by the smartcard in the mobile phone. 
						The DSS server connects to the mobile phone which requests the user to sign (the provided digest).
					</para>
					<para>
						This use case resembles the ETSI standard for Mobile Commerce (M-COMM) or	Mobile Signature Service <xref linkend="ETSI-M-COMM"/>.
					</para>
					<para>
						<figure id="fig-dss-localsigexample2">
							<title>A mobile phone for signature creation</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="200" align="center" width="600" 
										fileref="figure-5-use-case-2.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
					</para>
				</section>
				<section id="example3">
					<title>Use Case 3</title>
					<para>
						This use case assumes the use of a smartphone that contains a (secure) signature-creation device. 
						The smartphone contains an app to sign (a) document(s), although the actual electronic signature processing  functionality is delegated to a DSS server. 
						The app has implemented the DSS protocol and the use of the (secure) signature-creation device in the smartphone. 
						Note that the DSS server cannot access the (secure) signature-creation device without additional mechanisms;  proposals to solve this are presented in  section <xref linkend="solutions"/>.
					</para>
					<para>
						<figure id="fig-dss-localsigexample3">
							<title>A smartphone as a DSS client</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="200" align="center" width="600" 
										fileref="figure-6-use-case-3.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
					</para>
				</section>
				<section id="example4">
					<title>Use Case 4</title>
					<para>
						This use case is a generalisation of use case 2.
						It assumes the use of a mobile device that may contain a (secure) signature-creation device, in the proximity of the end user.
						If the mobile device does not contain a (secure) signature-creation device it is assumed that it is located at the "SCD Service".
						The mobile device can have more capabilities than a mobile phone. 
						For instance, a smartphone with an internet connection and an app to interact with the  "SCD Service".
					</para>
					<para>
						<figure id="fig-dss-localsigexample4">
							<title>Signature creation delegated to another service</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="250" align="center" width="600" 
										fileref="figure-7-use-case-4.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
					</para>
					<para>
						To sign (a) document(s), the client sends the document(s) to the 
						DSS server. The DSS server delegates the actual computation of the digital signature value to another service: 
						the digest is sent to the "SCD Service", with possibly (but not necessarily) a &lt;dss:SignRequest&gt; (A).
						The "SCD Service" is able to deliver a digital signature value, based on the 
						interaction with the mobile device by means of a certain protocol.
					</para>
					<para>
						If the smartphone contains a (secure) signature-creation device, it receives or retrieves the digest from the "SCD Service" and computes the digital signature value for the digest (3), 
						after which the digital signature value is returned to the "SCD Service". 
						The "SCD Service" responds with possibly (but not necessarily) a &lt;dss:SignResponse&gt; (B) to the DSS server.
					</para>
					<para>
						Note that some secure correlation is required between the initial user request and the interaction with the smartphone.
					</para>
					<para>
						This use case can make use of the ETSI standard for Mobile Commerce (M-COMM) or Mobile Signature Service <xref linkend="ETSI-M-COMM"/>  
					</para>
				</section>
			</section>
			<section id="solutions">
				<title>Proposed Solutions</title>
				<para>
					This section describes three possible technical solutions for different use cases.
					<itemizedlist>
						<listitem>
							<para>
								A User Agent at the client is introduced for use case 1 to access the (secure) signature-creation device (connected to the client platform) for the computation of the digital signature value.  
							</para>
						</listitem>
						<listitem>
							<para>
								A two-step approach is introduced for use case 1 and use case 3: the Digital Signature Service returns the document digest in the first step. After the client has computed the digital signature value for the document digest, it is
								returned to the Digital Signature Service in the second step (to enrich the digital signature value, for instance with a time-stamp and/or revocation information).
							</para>
						</listitem>
						<listitem>
							<para>
								A third-party is introduced for use case 2 and use case 4: the Digital Signature Service delegates the computation of the digital signature value to a third-party. 
								The third-party has some means to contact the (secure) signature-creation device of the end user.
							</para>
						</listitem>
					</itemizedlist> 
					
				</para>
				
				<section id="Connect-to-user-agent">
					<title>Introduction of a User Agent</title>
					<para>
						To provide the Digital Signature Service access to a LSCD, a User Agent is introduced. The User Agent MUST provide access to the LSCD.
						The DSS client communicates with the DSS server via the User Agent; there is no direct communication between the DSS client and DSS server. 
						The figure below illustrates how this is done.
					</para>
					<para>
						<figure id="fig-dss-localsigserver1">
							<title>A LSCD used by the DSS server</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="200" align="center" width="600" 
										fileref="figure-8-user-agent.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
					</para>
					<para>
						The order of actions is as follows:
						<itemizedlist>
							<listitem>
								<para>
									The DSS client sends the SignRequest to the User Agent.
								</para>
							</listitem>
							<listitem>
								<para>
									The User Agent sends the SignRequest to the DSS server (1). The DSS server has obtained a session (connection) with the User Agent.
								</para>
							</listitem>
							<listitem>
								<para>
									The DSS server calculates the digest (2) for the input document.
								</para>
							</listitem>
							<listitem>
								<para>
									In order to have the digest signed, an interaction between the User Agent and the LSCD (3) is required. 
									This interaction will be initated  by the DSS server, by means of the session (connection) that has been obtained earlier. 
									This profile does not specify how the User Agent obtains the digital signature value: it is left to the implementers.
								</para>
							</listitem>
							<listitem>
								<para>
									Once the digital signature value has been obtained, the DSS server creates and processes (4) the electronic signature according the the request, and the SignResponse is built.
									(If requested, the electronic signature is embedded into the document.) 
								</para>
							</listitem>
							<listitem>
								<para>The DSS server sends the SignResponse to the User Agent (5)</para>
							</listitem>
							<listitem>
								<para>
									The User Agent sends the SignResponse to the DSS client.
								</para>
							</listitem>
						</itemizedlist>
					</para>
					<para>
						For achieving this User Agent approach a transport binding needs to be introduced:
					</para>
					<para>
						<itemizedlist>
							<listitem>
								<para>
									A HTTP transport binding is defined for the use of a User Agent and HTML forms. 
									The HTML form initiates a HTTP POST (from within the User Agent) to the specified action location (either the DSS server or the DSS client).
									This transport binding is referred to as a <emphasis>WEB FORM transport binding</emphasis> and can be found in <xref linkend="section-http-post-binding"/>.
								</para>
							</listitem>
						</itemizedlist>
					</para>
				</section>
				
				<section id="two-step-approach">
					<title>Introduction of a Two-Step Approach</title>
					<para>
						The OASIS DSS protocol could be split into two related request/response pairs, such that the client can obtain a digest of the document in the FIRST request/response.
						The client MUST be capable of accessing the LSCD.
						The client interacts with the LSCD to compute the digital signature value and sends it back to the DSS server by means of the SECOND request/response.
						<figure id="fig-dss-localsigclient">
							<title>An LSCD used by the DSS client.</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="200" align="center" width="600" 
										fileref="figure-9-two-step-approach.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
					</para>
					<para>
						The order of actions is as follows:
						<itemizedlist>
							<listitem>
								<para>
									The first step consists of a SignRequest (1) - SignResponse (3) pair where the SignResponse only contains the digest, calculated by the Digital Signature Service (2).
								</para>
							</listitem>
							<listitem>
								<para>
									This digest is used by the client application to compute the digital signature value (4) by means of the (secure) signature-creation device at the client.
								</para>	
							</listitem>
							<listitem>
								<para>
									The second step consist of a SignRequest (5) - SignResponse (7) pair where the SignRequest contains the digital signature value. 
									The Digital Signature Service builts and processes (6) the electronic signature based on the digital signature value and the request received.
									The result is sent to the client with the SignResponse (7).
								</para>
							</listitem>
						</itemizedlist>
					</para>
					<para>
						Note that no assumptions are made about the actual connection or communication between the client and LSCD. 
						(Although the core DSS protocol could be used to send a <code>&lt;dss:DocumentHash&gt;</code> to the LSCD and to obtain a  <code>&lt;SignatureObject&gt;</code>.)
						The only assumption is that the client that implements the (client-side of the) DSS protocol is capable of using the LSCD.
					</para>
					<para>
						For achieving this two-step approach some OptionalInputs and OptionalOutputs elements need to be introduced for the SignRequest or SignResponse:
					</para>
					<para>
						<orderedlist>
							<listitem>
								<para>
									An optional output <code>&lt;ds:DocumentHash&gt;</code> element  in the SignResponse. 
									After the DSS server has received a SignRequest it calculates the digest of the document.
									The SignResponse contains the <code>&lt;dss:DocumentHash&gt;</code> value.
								</para>
							</listitem>
							<listitem>
								<para>
									An optional input <code>&lt;dss:SignatureObject&gt;</code> element in the second SignRequest. 
									After the DSS client has received the digest as a result of the first SignRequest, the LSCD computes the digital signature value and the 
									client incorporates it to the aforementioned SignRequest using the <code>&lt;dss:SignatureObject&gt;</code> element. 
									The DSS server will perform the necessary operations for building the final electronic signature, for incorporating it within the corresponding document if 
									required, and for returning it within the corresponding SignResponse.
								</para>
							</listitem>
							<listitem>
								<para>
									An optional output (resp. input) <code>&lt;localsig:CorrelationID&gt;</code> element in the first SignResponse (resp. second SignRequest). 
									The correlation identifier is used to relate the first and second SignRequest/SignResponse pairs.
								</para>
							</listitem>
						</orderedlist>
						
					</para>
				</section>
				<section id="third-party">
					<title>Introduction of a Third-Party</title>
					<para>
						The Digital Signature Service delegates the computation of the digital signature value to a third-party for users with a mobile device that MAY contain a (secure) signature creation device
						(in that case, the mobile device contains the LSCD).
						If the mobile device does not contain a (secure) signature-creation device it is assumed that the third-party provides access to the RSCD on behalf of the end user by means of the mobile device.
						See for instance <xref linkend="example2"/>  and <xref linkend="example4"/> .
					</para>
					<para>
						<figure id="fig-dss-localsig-thirdparty">
							<title>Signature creation delegated to a third-party.</title>
							<mediaobject>
								<imageobject>
									<imagedata depth="200" align="center" width="600" 
										fileref="figure-10-third-party.png" format="PNG"/>
								</imageobject>
							</mediaobject>
						</figure>
					</para>
					<para>
						Because the end user must be assured that it signs the correct request, an additional mechanism is introduced: a challenge code. 
						The challenge code is a kind of 'one-time-password': it is different for every session. 
						The challenge code will be shown at the client screen as well as the screen of the mobile device (the DSS server sends the challenge code to the third-party). 
						The end user compares the codes and if they are the same confirms the sign request.
					</para>
					<para>
						<emphasis>
							Note. The challenge code could even be used for a kind of challenge-response authentication by the
							Digital Signature Service. If the SignRequest also contains a response code, it is expected that the end user
							enters that code at the mobile device. The electronic signature is only created and processed (by the Digital Signature Service) if the
							response codes match. Note that the challenge-response does not protect the end user from misuse
							of the signature by the third-party. (But the signature is bound to the document by means of a unique
							hash value, making it useless for other documents.)
						</emphasis>
					</para>
					<para>
						The DSS client MUST be able to create the challenge (and optionally a response) code, unique for every session, and MUST display the code(s) onto the screen of the client.
					</para>
					<para>
						The order of actions is as follows:
						<itemizedlist>
							<listitem>
								
								<para>
									The client sends a SignRequest, which also contains a challenge code, to the Digital Signature Service (1).
								</para>
							</listitem>
							<listitem>	
								<para>
									The Digital Signature Service calculates the digest of the document  (2) and delegates the computation of the digital signature value to a third-party (3), for instance a Mobile Signature Service.
									
								</para>
							</listitem>
							<listitem>
								<para>
									The third-party sends the request to the mobile device of the end user.
									The end user has to compare the challenge code with the code that is shown on the mobile device (as part of the information that is sent from the third-party to the mobile device). 
									Once the end user has confirmed the code, the mobile device computes the digital signature value (4) and sends it back to the third-party. 
									The third-party returns the digital signature value to the Digital Signature Service.
								</para>
							</listitem>
							<listitem>
								<para>
									The Digital Signature Service creates and processes the electronic signature (5) based on the digital signature value and the request received. 
									The resulting electronic signature is returned to the client in the SignResponse (6).
								</para>
							</listitem>
						</itemizedlist>
					</para>
					
					<para>
						The protocol between the Digital Signature Service and third-party is not specified by this profile, but the DSS protocol can be used for this as well, see for instance <xref linkend="fig-dss-extended1b"/>. 
						(It is assumed that the challenge code is included in the request to the third-party.)
					</para>
					<para>
						Note that information is required about the identity of the end user to enable the third-party to communicate with the appropriate mobile device.
						It is assumed that the element <code>&lt;dss:ClaimedIdentity&gt;</code> is sufficient for this purpose.
					</para>
					<para>
						For achieving this third-party approach some OptionalInputs elements need to be introduced for the SignRequest:
					</para>
					<para>
						<orderedlist>
							<listitem>
								<para>
									An optional input <code>&lt;localsig:ChallengeCode&gt;</code> element in the SignRequest. 
									The challenge code is shown at the screen of the mobile device as well as the screen of the client.
								</para>
							</listitem>
							<listitem>
								<para>
									An optional input <code>&lt;localsig:ResponseCode&gt;</code> element in the SignRequest. 
									The response code MAY be entered at the mobile device after which it is sent back to the Digital Signature Service by the third-party.
								</para>
							</listitem>
						</orderedlist>
						
					</para>
					
				</section>
				
				<!-- 
					<section id="variant2b">
					<title>Variant 2b</title>
					
					<para>The following mechanisms are introduced to enable the use of a LSCD by a DSS server:
					<orderedlist>
					<listitem>
					<para>An existing web browser session (similar to variant 2a).
					</para>
					</listitem>
					<listitem>
					<para>Secure conversation, to secure the different asynchronous requests and responses between the DSS client and DSS server.
					</para>
					</listitem>
					<listitem>
					<para>Asynchronous processing profile, as defined in <xref linkend="dssAsync"/>.
					Note: the following restriction is relaxed for the use of the <code>&lt;wst:SecurityToken&gt;</code> element (required for the secure conversation): 
					<emphasis>
					If the server returns the <code>&lt;ResultMajor&gt;</code> code 'Pending'
					the contents of the <code>&lt;OptionalOutputs&gt;</code> element children other than
					<code>&lt;async:CorrelationID&gt;</code> are undefined.
					</emphasis> 
					</para>
					</listitem>
					</orderedlist>
					</para>
					
					<para>This variant is similar to the previous one, except that the document is sent asynchronous. 
					The DSS client first sends the document to the DSS server (1a) after which a HTTP-POST request is sent (via the web browser to the DSS server) with a PendingRequest (1b). 
					The DSS server presents a screen in which the end user can sign the document using the LSCD (2). When the end user has finished,
					the DSS server responds to the web browser with a HTTP-POST request that contains a SignResponse (together with a request ID related to the resulting document). 
					The HTTP-POST request contains code that will redirect the request to the DSS client, thereby returning the SignResponse to the DSS client (3a). 
					The DSS client retrieves the resulting document form the DSS server with a PendingRequest (3b).
					<figure id="fig-dss-localsigserver2">
					<title>A LSCD used by the DSS server</title>
					<mediaobject>
					<imageobject>
					<imagedata depth="350" align="center" width="600" 
					fileref="oasis-dss-localsig-server2.png" format="PNG"/>
					</imageobject>
					</mediaobject>
					</figure>
					</para>
					
					</section>
				-->
				
			</section>
			
		</section>
		
	</section>
	<section id="section-profile-features">
		<title>Profile Features</title>
		<section id="section-identifier">
			<title>Identifier</title>
			<para>The attribute <code>Profile</code> MUST have the value:
				<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig</code></programlisting>
			</para>
		</section>
		<section id="section-scope">
			<title>Scope</title>
			<para>
				This profile extends the OASIS DSS signing functionalitiy <xref linkend="dssCore"/>
				such that end users can bring (use) their own (secure) signature-creation device. Such a device is 
				referrenced as <emphasis>local (secure) signature-creation device</emphasis> and is abbreviated to LSCD.
			</para>
			<para>
				This profile does not fully explore the use of a RSCD (see <xref linkend="fig-dss-extended1"/>);
				only the third-party solution MAY support the use of a RSCD.
			</para>
		</section>
		<section id="section-relationship-to-other-profiles">
			<title>Relationship to Other Profiles</title>
			<para>The profile in this document is based on the <xref linkend="dssCore"/>.
			</para>	
			<para>This profile provides means for the explicit management of local signature computations with <xref linkend="dssCore"/> 
				and other existing profiles, and as such, it may be used in conjunction with these specifications.
			</para>
		</section>
		
	</section>
	
	<section id="section-profile-of-signing-protocol">
		<title>Profile of Signing Protocol</title>
		<!-- 
			*************************************************************  User Agent with WEB FORM  ******************************************************************************************************** 
		-->		
		<section id="section-LSCD-Used-by-the-Server">
			<title>User Agent</title>
			<para>
				This clause enables the DSS client to obtain an electronic signature or signed document using a (secure) signature-creation device from an end user in a single interaction with the Digital Signature Service by means of a HTTP User Agent. 
				The HTTP User Agent is responsible for the creation of the digital signature value using a (secure) signature-creation device at the client.
			</para>
			<para>
				The HTTP User Agent MUST be able to access the (secure) signature-creation device to create the digital signature value.
			</para>
			<para>
				A transport binding is required that creates a session between the Digital Signature Service and the HTTP User Agent agent, see <xref linkend="section-http-post-binding"/>.  
			</para>
			<para>
				The Digital Signature Service uses the session with the HTTP User Agent to obtain the digital signature value from the HTTP User Agent.
				How this functionality is implemented is not specified and is not part of this profile: it depends on the capabilities of the HTTP User Agent and the client platform 
				(e.g. through the use of a Java Applet in the web browser and a PKCS#11 device driver at the client platform).
			</para>
			<section id="section-client-sign-request2">
				<title>Element &lt;dss:SignRequest&gt;</title>
				<para>
					This clause profiles the &lt;dss:SignRequest&gt; element.
				</para>
				<para>
					The attribute <code>Profile</code> MUST have the value:
					<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig</code></programlisting>
				</para>
				<section id="section-pendingrequest-optionalinputs3">
					<title>Element &lt;dss:OptionalInputs&gt;</title>
					<para>
						This clause profiles the use of Optional Input elements.
					</para>
					<section id="section-signrequest2-policy">
						<title>Element &lt;dss:ServicePolicy&gt;</title>
						<para>
							The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present and MUST have the value:
							<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/user-agent</code></programlisting>
							This policy instructs the Digital Signature Service to initiate the interaction with the User Agent to access the (secure) signature-creation device of the end user. 
						</para>
					</section>
					<section id="section-signrequest2-digestmethod">
						<title>Element &lt;ds:DigestMethod&gt;</title>
						<para>
							The new element <code>&lt;ds:DigestMethod&gt;</code> MAY be present to specify which digest method has to be used by the Digital Signature Service.
						</para>
					</section>
					
				</section>
			</section>
			<section id="section-client-sign-response2">
				<title>Element &lt;dss:SignResponse&gt;</title>
				<para>This clause profiles the &lt;dss:SignResponse&gt; element.</para>
				
				<para>
					No new elements are defined; the <code>&lt;dss:SignResponse&gt;</code> contains either the electronic signature or the signed document according to the <xref linkend="dssCore"/>, or an error message.
				</para>
				<section id="section-signresponse2-results">
					<title>Element &lt;dss:Result&gt;</title>
					<para>
						In case the end user cancelled the signing operation, the Digital Signature Service returns a
						<code>&lt;dss:ResultMajor&gt;</code> with the value <code>RequesterError</code> and a <code>&lt;dss:ResultMinor&gt;</code> with the value:
						<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:user-cancelled</code></programlisting>
					</para>
					<para>
						In case the Digital Signature Service detects a problem with the client runtime environment,
						the service returns a <code>&lt;dss:ResultMajor&gt;</code> with the value <code>RequesterError</code> and
						a <code>&lt;dss:ResultMinor&gt;</code> with the value:
						<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:client-runtime-error</code></programlisting>
						<beginpage/>
					</para>
				</section>
			</section>
		</section>
		
		<!-- 
			*************************************************************  TWO-STEP APPROACH ******************************************************************************************************** 
		-->
		<section id="section-LSCD-Used-by-the-Client">
			<title>Two-Step Approach</title>
			<para>				
				This clause enables the client to obtain a signed document in two steps; 
				the client is responsible for the creation of the digital signature value using a (secure) signature-creation device.
			</para>
			<para>
				The main <code>&lt;dss:SignRequest&gt;</code> and <code>&lt;dss:SignResponse&gt;</code> are processed in two separate, 
				consecutive, interactions with the Digital Signature Service. 
			</para>
			<para>
				The <emphasis>first step</emphasis> initiates the process by sending the document 
				to the Digital Signature Service with the FIRST <code>&lt;dss:SignRequest&gt;</code>. Only the digest of the document is received in the FIRST <code>&lt;dss:SignResponse&gt;</code>.
				The Digital Signature Service will postpone processing of the document until the <code>&lt;dss:SignatureObject&gt;</code> is received in the second step.
			</para>
			<para>
				The <emphasis>second step</emphasis> finalizes the process by sending
				the <code>&lt;dss:SignatureObject&gt;</code> to the Digital Signature Service 
				with the SECOND <code>&lt;dss:SignRequest&gt;</code>.
				The Digital Signature Service responds with the SECOND (and final) <code>&lt;dss:SignResponse&gt;</code> which contains the electronic signature or signed document, depending what has been requested.
			</para>
			
			<section id="section-client-sign-request">
				<title>Element &lt;dss:SignRequest&gt;</title>
				<para>
					This clause profiles the <code>&lt;dss:SignRequest&gt;</code> element.
				</para>
				<para>
					The attribute <code>Profile</code> MUST have the value:
					<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig</code></programlisting>
				</para>
				<para>
					The element <code>&lt;dss:InputDocuments&gt;</code> MUST be present in the FIRST request and MAY be present in the 
					SECOND request. If present in the SECOND request, it MUST contain the document as used in the FIRST request.
				</para>	
				<section id="section-signrequest-optionalinputs-first">
					<title>Element &lt;dss:OptionalInputs&gt;</title>
					<para>
						This clause profiles Optional Input elements.
					</para>
					<section id="section-signrequest3-policy">
						<title>Element &lt;dss:ServicePolicy&gt;</title>
						<para>
							The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present and MUST have the value:
							<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/two-step-approach</code></programlisting>
							This policy instructs the Digital Signature Service that two request/response pairs are used to obtain the digital signature value from the (secure) signature-creation device of the end user. 
						</para>
					</section>
					<section id="section-signrequest-RequestDocumentHash">
						<title>Element &lt;localsig:RequestDocumentHash&gt;</title>
						<para>
							The new element <code>&lt;localsig:RequestDocumentHash&gt;</code> MUST be present in the FIRST request.  
							The type of the element is defined as follows:
							<programlisting language="XML"><![CDATA[   <xs:element name="ReturnDocumentHash">
      <xs:complexType>
         <xs:sequence>
            <xs:element 
                 minOccurs="0" maxOccurs="1"
                 ref="ds:DigestMethod"/>
         </xs:sequence>
         <xs:attribute 
                 name="MaintainRequestState" 
                 use="optional" 
                 type="xs:boolean"/>
      </xs:complexType>
   </xs:element>
]]></programlisting>
						</para>
						<para>
							The element <code>&lt;localsig:ReturnDocumentHash&gt;</code> instructs the Digital Signature Service to return the digest of the document and to postpone further processing. 
						</para>
						<para>
							The attribute <code>MaintainRequestState</code> MAY be used to instruct the Digital Signature Service to maintain the state of the request,
							until the SECOND request is received or a certain predefined timeout has been reached (the timeout is determined by the Digital Signature Service).
							If the attribute is not specified, the assumed value is <code>false</code>. 
							If the attribute <code>MaintainRequestState</code> is not used or <code>false</code>, then the SECOND request MUST contain the same document as specified in the FIRST request.
						</para>
						<para>
							The element <code>&lt;ds:DigestMethod&gt;</code> MAY be used to instruct the Digital Signature Service to use the specified type of digest method. If no method is specified, 
							the Digital Signature Service will use a default digest method.
						</para>
						<para>
							<emphasis>Note.</emphasis> The state is only useful (i) in case the document digest cannot be easily re-created, for instance if a signature has to be incorporated into a PDF document, or (ii) the document
							has to be transferred only once. 
						</para>
					</section>
					<section id="section-signrequest-SignatureObject">
						<title>Element &lt;dss:SignatureObject&gt;</title>
						<para>
							The element <code>&lt;dss:SignatureObject&gt;</code> MUST be used in the SECOND request to provide the digital signature value, obtained from the (secure) signature-creation device at the client.
							The Digital Signature Service creates and processes the electronic signature based on the <code>&lt;dss:SignatureObject&gt;</code> and the request, according to the  <xref linkend="dssCore"/> specification.
						</para>
						<para>
							A <code>&lt;dss:Base64Signature&gt;</code>element MUST be used for the digital signature value together with a specified value for the <code>type</code> attribute. 
							For OID's a urn according to <xref linkend="rfc3061"/> and <xref linkend="draft-larmouth-oid-iri-04"/> MAY be used.
						</para>
					</section>
					<section id="section-signrequest-CorrelationID">
						<title>Element &lt;localsig:CorrelationID&gt;</title>
						<para>
							The new  element <code>&lt;localsig:CorrelationID&gt;</code> MUST only be used in the SECOND request if and only if the FIRST response contained the element <code>&lt;localsig:CorrelationID&gt;</code>. 
							(Their value MUST be the same.) The type of the element is defined as follows:
							<programlisting language="XML"><![CDATA[   <xs:element name="CorrelationID" type="xs:NCName"/>
]]></programlisting>
						</para>	
					</section>
				</section>
			</section>
			<section id="section-client-sign-response-first">
				<title>Element &lt;dss:SignResponse&gt;</title>
				<para>
					This clause profiles the <code>&lt;dss:SignResponse&gt;</code> element.
				</para>
				<section id="section-signresponse1-results">
					<title>Element &lt;dss:Result&gt;</title>
					<para>
						In response to a successfull processing of a <code>&lt;dss:SignRequest&gt;</code> 
						that specified the element <code>&lt;localsig:ReturnDocumentHash&gt;</code>,
						the <code>&lt;dss:ResultMajor&gt;</code> contains the value <code>Success</code> and
						the <code>&lt;dss:ResultMinor&gt;</code> the value:
						<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:document-hash</code></programlisting>
					</para>
					<para>
						In response to a successfull processing of a <code>&lt;dss:SignRequest&gt;</code> 
						that specified the element <code>&lt;localsig:SignatureObject&gt;</code>,
						the <code>&lt;dss:ResultMajor&gt;</code> and <code>&lt;dss:ResultMinor&gt;</code> follow the 
						<xref linkend="dssCore"/> specification.
					</para>
				</section>
				<section id="section-signresponse-optionalinputs">
					<title>Element &lt;dss:OptionalOutputs&gt;</title>
					<para>
						This profile defines the new optional output elements.
					</para>
					
					<section id="section-signresponse-DocumentHash">
						<title>Element &lt;dss:DocumentHash&gt;</title>
						<para>
							The new element  <code>&lt;dss:DocumentHash&gt;</code> MUST be returned in response to a <code>&lt;dss:SignRequest&gt;</code> 
							that specified the element <code>&lt;localsig:ReturnDocumentHash&gt;</code>.
						</para>
						<para>
							This element uses the existing <xref linkend="dssCore"/> type definition of <code>&lt;dss:DocumentHash&gt;</code>.
						</para>
						<para>
							The client uses the document digest for further processing by the (secure) signature-creation device.
						</para>
					</section>
					
					<section id="section-signresponse-CorrelationID">
						<title>Element &lt;dss:CorrelationID&gt;</title>
						
						<para>
							The new element <code>&lt;localsig:CorrelationID&gt;</code> MUST be returned in response to a <code>&lt;dss:SignRequest&gt;</code>
							if and only if the element <code>&lt;localsig:ReturnDocumentHash&gt;</code> element was present within the SignRequest and its MaintainRequestState attribute was set to <code>true</code>.
						</para>
						<para>
							The Digital Signature Service will generate a suitable value on its own behalf so that a client can refer to the state of its FIRST request. 
						</para>
						<para>
							The client MUST use this value in the SECOND request to refer to this state.
						</para>		
					</section>					
				</section>
				
			</section>
		</section>
		<!-- 
			*************************************************************  THIRD-PARTY ******************************************************************************************************** 
		-->
		<section id="section-thirdparty">
			<title>Third-Party</title>
			<para>
				This clause enables the client to obtain an electronic signature (or signed document whenever requested) from the Digital Signature Service.
			</para>			
			<section id="section-client-sign-request-thirdparty">
				<title>Element &lt;dss:SignRequest&gt;</title>
				<para>
					This clause profiles the <code>&lt;dss:SignRequest&gt;</code> element.
				</para>
				<para>
					The attribute <code>Profile</code> MUST have the value:
					<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig</code></programlisting>
				</para>
				<section id="section-signrequest-optionalinputs-first-thirdparty">
					<title>Element &lt;dss:OptionalInputs&gt;</title>
					<para>
						This clause profiles the (new) elements for the OptionalInputs.
					</para>
					<section id="section-signrequest2-policy-thirdparty">
						<title>Element &lt;dss:ServicePolicy&gt;</title>
						<para>
							The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present and MUST have the value:
							<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/delegation</code></programlisting>
							This policy instructs the Digital Signature Service to delegate the creation of the signature to a third-party.
						</para>
					</section>
					<section id="section-signrequest2-digestmethod-thirdparty">
						<title>Element &lt;ds:DigestMethod&gt;</title>
						<para>
							The new element <code>&lt;ds:DigestMethod&gt;</code> MAY be present to specify which digest method has to be used by the Digital Signature Service.
						</para>
					</section>
					<section id="section-signresponse-ChallengeCode-thirdparty">
						<title>Element &lt;localsig:ChallengeCode&gt;</title>
						<para>
							The new element  <code>&lt;localsig:ChallengeCode&gt;</code> MUST be present in the request and MUST have a random value that can easily be read by a person.
							The type of the element is defined as follows:
							<programlisting language="XML"><![CDATA[   <xs:element name="ChallengeCode" type="xs:NCName"/>
]]></programlisting>
						</para>	
						<para>
							The client has to show the challenge code to the end user. 
							The end user MUST be able to compare the code with the value that is shown on the mobile device
							before it confirms the computation of the digital signature value by the mobile device (the challenge code is sent to the third-party as well).
						</para>
					</section>
					
					<section id="section-signresponse-ResponseCode-thirdparty">
						<title>Element &lt;localsig:ResponseCode&gt;</title>
						<para>
							The new element  <code>&lt;localsig:ResponseCode&gt;</code> MAY be present in the request. If present it MUST have a random value that can easily be read and entered by a person.
							The type of the element is defined as follows:
							<programlisting language="XML"><![CDATA[   <xs:element name="ResponseCode" type="xs:NCName"/>
]]></programlisting>
						</para>	
						<para>
							The client has to show the response code to the end user. 
							The end user MUST be able to enter the response code at the mobile device before it confirms the computation of the digital signature value by the mobile device; 
							the third-party MUST return the response code to the Digital Signature Service.
							The Digital Signature Service only creates the requested electronic signature if the response code matches the value that was given by the client in the request.
						</para>
					</section>
				</section>
			</section>
			<section id="section-client-sign-response-first-thirdparty">
				<title>Element &lt;dss:SignResponse&gt;</title>
				<para>
					This clause profiles the <code>&lt;dss:SignResponse&gt;</code> element.
				</para>
				<section id="section-signresponse1-results-thirdparty">
					<title>Element &lt;dss:Result&gt;</title>
					<para>
						If the signature creation is cancelled by the end user
						the <code>&lt;dss:ResultMajor&gt;</code> contains the value for ResponderError and
						the <code>&lt;dss:ResultMinor&gt;</code> the value:
						<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:user-cancelled</code></programlisting>
					</para>
					<para>
						If the third-party is not able to handle the signature creation
						the <code>&lt;dss:ResultMajor&gt;</code> contains the value for ResponderError and
						the <code>&lt;dss:ResultMinor&gt;</code> the value:
						<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:delegation-failed</code></programlisting>
					</para>
					<para>
						If the response code that is returned by the third-party does not correspond to the value that is provided in the request,
						the <code>&lt;dss:ResultMajor&gt;</code> contains the value for ResponderError and
						the <code>&lt;dss:ResultMinor&gt;</code> the value:
						<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:incorrect-responsecode</code></programlisting>
					</para>
				</section>
			</section>
		</section>
	</section>
	
		
	<!-- 
		*************************************************************  BINDING ******************************************************************************************************** 
	-->		
	
	<section id="bindings">
		<title>Protocol Bindings</title>
		<para>
			OASIS DSS bindings are categorized under either transport bindings or security bindings as defined under section 6 of <xref linkend="dssCore"/>. 
			The DSS signing protocol messages inherently assume that all security aspects are covered by the transport binding and appropriate
			security binding. 
		</para>
		<para>
			In section <xref linkend="section-LSCD-Used-by-the-Server"/>  a transport binding is assumed by which a session is established between the Digital Signature Service 
			and the HTTP User Agent. This document profiles a binding for a HTTP User Agent at the client using a web form.
		</para>
		<para> 
			In section <xref linkend="section-LSCD-Used-by-the-Client"/> it is assumed that a session (transaction) is created 
			when a request contains the element <code>&lt;localsig:ReturnDocumentHash&gt;</code> with the attribute <code>MaintainRequestState="true"</code>. The session is not profiled in this document.
		</para>
		<section id="section-http-post-binding">
			<title>WEB FORM Transport Binding</title>
			<para> A WEB FORM binding is defined as a mechanism by which OASIS DSS protocol messages may be
				transmitted within the base64-encoded content of a HTML form control. </para>
			<para> The reference URI for this binding is:
				<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:bindings:web-form</code></programlisting>
			</para>
			<section>
				<title>Overview</title>
				<para> 
					The WEB FORM binding is intended for those cases where a requester and
					responder need to communicate using a HTTP User Agent (as defined in HTTP 1.1
					<xref linkend="RFC2616"/> ) as an intermediary. This may be necessary, for
					example, if the communicating parties do not share a direct path of
					communication. It may also be needed if the responder requires an interaction
					with the User Agent in order to fulfill the request, such as when the User Agent
					must authenticate itself. 
				</para>
				<para>
					The OASIS DSS  <code>&lt;dss:SignRequest&gt;</code> 
					and <code>&lt;dss:SignResponse&gt;</code> XML messages are encoded into
					a HTML form, as described in the next Section.
				</para>
			</section>
			<section>
				<title>Message Encoding using a HTML form</title>
				<para>
					The HTML document MUST adhere to the XHTML 1.0 specification <xref linkend="XHTML"/> to
					ease parsing. 
				</para>
				<para> 
					The <code>action</code> attribute of the HTML form MUST be the
					HTTP endpoint of the recipient: either the OASIS Digital Signature Service in case of the <code>&lt;dss:SignRequest&gt;</code> 
					or the client in case of the <code>&lt;dss:SignResponse&gt;</code>. 
				</para>
				<para> 
					The <code>method</code> attribute of the HTML form MUST be <code>POST</code>. 
				</para>
				<para> 
					A  <code>&lt;dss:SignRequest&gt;</code> or a <code>&lt;dss:SignResponse&gt;</code> message MUST be base64-encoded and 
					placed in a hidden HTML form control
					within the HTML form (as defined by <xref linkend="HTML401"/> Section 17).  The base64-encoded value MAY be line-wrapped at a reasonable
					length in accordance with common practice. 
					<itemizedlist>
						<listitem>
							<para>
								If the message contains an OASIS DSS <code>&lt;dss:SignRequest&gt;</code> then the hidden HTML form control MUST be named
								<code>signrequest</code>. 
							</para>
						</listitem>
						<listitem>
							<para>
								If the message contains an OASIS DSS <code>&lt;dss:SignResponse&gt;</code>, then the hidden HTML form control MUST be named 
								<code>signresponse</code>. 
							</para>
						</listitem>
					</itemizedlist>
				</para>
				<para>
					The  <code>clienturl</code> attribute MAY be used to provide the Digital Signature Service with a client URL.					
					This URL will be used by the Digital Signature Service for the transmission of the response HTML form.
					If the <code>clienturl</code> is not specified, either an error is returned to the HTTP agent or a predefined URL is used by the 
					Digital Signature Service.
				</para>
				<para>
					Any additional HTML form controls or presentation MAY be included to allow
					the recipient to process the message.
				</para>
				<para> 
					Any technique supported by the User Agent MAY be used to cause the submission
					of the HTML form, and any HTML form content necessary to support this MAY be included,
					such as submit controls and client-side scripting commands. However, the
					Digital Signature Service MUST be able to process the message regardless for the mechanism by
					which the form submission is initiated. 
				</para>
				<para> 
					Note that any HTML form control values included MUST be transformed so as to be
					safe to include in the XHTML document. This includes transforming characters
					such as quotes into HTML entities, etc. 
				</para>
			</section>
			<section>
				<title>HTTP and Caching Considerations</title>
				<para> HTTP proxies and the User Agent intermediary should not cache OASIS DSS protocol
					messages. To ensure this, the following rules SHOULD be followed. When returning
					OASIS DSS protocol messages using HTTP 1.1, HTTP responders SHOULD: </para>
				<itemizedlist>
					<listitem>
						<para> Include a <code>Cache-Control</code> header field set to &quot;
								<code>no-cache, no-store</code> &quot;. </para>
					</listitem>
					<listitem>
						<para> Include a <code>Pragma</code> header field set to &quot;
								<code>no-cache</code> &quot;. </para>
					</listitem>
				</itemizedlist>
				<para> There are no other restrictions on the use of HTTP headers. </para>
			</section>
		</section>

		<section id="message-security-binding">
			<title>Security Binding</title>
			<section>
				<title>Security Considerations</title>
				<para> 
					Before deployment, each combination of profile, transport binding, and security
					binding SHOULD be analyzed for vulnerability in the context of the specific protocol
					exchange and the deployment environment. Below we illustrate some of the security
					concerns that often come up with protocols of this type, but we stress that this is
					not an exhaustive list of concerns. 
				</para>
				<para> 
					As the OASIS DSS protocol defined in this document is similar to the SAML protocol most
					of the security considerations defined in <xref linkend="samlCore"/> also apply to
					the OASIS DSS protocol. </para>
				<para> 
					The creation of document signatures using the OASIS DSS protocol yields additional attack
					vectors, due to possible manipulations of the document that is being transferred between DSS client and a DSS server.
					If the end user signs a different document as assumed by the DSS client, the impact could be huge.
					Therefore, it is of eminent importance to properly secure the OASIS DSS protocol request message that is transferred from DSS client
					to the DSS server via an intermediate User Agent.</para>
			</section>
			
			<section>
				<title>TLS Security</title>
				<para>
					The <xref linkend="section-http-post-binding"/> SHOULD be used with the TLS Security
					Bindings as defined under section 6.3 of <xref linkend="dssCore"/>. 
				</para>
			</section>
			
			<section>
				<title>Claimed Identity</title>
				<para> 
					The DSS Client can include the optional
					<code>&lt;dss:ClaimedIdentity&gt;</code> element as defined in <xref
						linkend="dssCore"/> section 2.8.2 to indicate the identity of the client who
					is making the request. The information provided by
					<code>&lt;dss:ClaimedIdentity&gt;</code> can be used to further
					personalize the interface presented to the end user by the DSS server.
				</para>
				<para> 
					In case the DSS server detects a problem with the claimed identity, the
					service returns in  <code>&lt;dss:SignResponse&gt;</code> a
					<code>&lt;dss:ResultMajor&gt;</code> with the value <code>RequesterError</code>
					and a <code>&lt;dss:ResultMinor&gt;</code> with the value:
					<programlisting><code>urn:oasis:names:tc:dss-x:profiles:localsig:resultminor:claimed-identity</code></programlisting>
				</para>
			</section>
		</section>
		<!--
		<section id="secure-conversation-security-binding">
			<title>Secure Conversation Security Binding</title>
			<para>
				
			</para>
		</section>
		<section id="section-localsig-profile">
			<title>Local Signature Computation Profile</title>
			<para> When using the <code>&lt;SignRequest&gt;</code> and
					<code>&lt;SignResponse&gt;</code> messages defined in <xref
						linkend="section-profile-of-signing-protocol"/> the following URI SHALL be added to the
					<code>&lt;dss:AdditionalProfile&gt;</code> element within the embedded
					<code>&lt;dss:SignRequest&gt;</code> element. </para>
			<para>
				<code>urn:oasis:names:tc:dss-x:profiles:localsig</code>
			</para>
			<para> A protocol transport binding as defined under <xref linkend="bindings"/> SHALL be
				used. The <xref linkend="http-post-binding"/> SHOULD be used in combination with
					<xref linkend="message-security-binding"/>, together with the TLS Security
				Bindings as defined under section 6.3 of <xref linkend="dssCore"/>. </para>
			<para> The relying party SHOULD include the optional input
					<code>&lt;dss:Language&gt;</code> element as defined in <xref
					linkend="dssCore"/> section 2.8.3 to indicate the preferred localization to be
				used by the OASIS DSS server. </para>
			<para> In case the end user cancelled the signing operation, the service returns in
					<code>&lt;SignResponse&gt;</code> a
					<code>&lt;dss:ResultMajor&gt;</code> of <code>RequesterError</code> and
				a <code>&lt;dss:ResultMinor&gt;</code> of </para>
			<para>
				<code>urn:oasis:names:tc:dss-x:profiles:localsig:resultminor:user-cancelled
				</code>
			</para>
			<para> In case the Digital Signature Service detects a problem with the client runtime environment,
				the service returns in <code>&lt;SignResponse&gt;</code> a
					<code>&lt;dss:ResultMajor&gt;</code> of <code>RequesterError</code> and
				a <code>&lt;dss:ResultMinor&gt;</code> of </para>
			<para>
				<code>urn:oasis:names:tc:dss-x:profiles:localsig:resultminor:client-runtime
				</code>
			</para>

		</section>
		<section>
			<title>Artifact Profile</title>
			<para> Passing large documents for signing via a User Agent may result in a bad end user
				experience due to document transfer delays. Hence the need for a profile that uses a
				SOAP web service for passing the documents between relying party and OASIS DSS. This
				profile is based on the OASIS DSS Asynchronous Processing Abstract Profile <xref
					linkend="dssAsync"/>. </para>
			<para> For the establishment of a shared secret the <xref
					linkend="secure-conversation-security-binding"/> can be used. When using this
				security binding, the lifecycle of the document that is stored in the OASIS DSS temporary
				document repository SHOULD correspond with the lifecycle of the secure conversation
				context. </para>
			<section id="section-prepare-signing">
				<title>Prepare for signing</title>
				<para>This section describes the request and response messages to prepare for a
					signing operation. </para>
				<para> The actual document signing ceremony is initated via the OASIS DSS protocol
					messages defined in REF and involves the
					User Agent. </para>
				<section>
					<title>SignRequest</title>
					<para> The <code>&lt;dss:SignRequest&gt;</code> message is used to
						transfer the to be signed document to the OASIS DSS server. </para>
					<para> Add an <code>&lt;dss:AdditionalProfile&gt;</code> element
						containing the following URI to use this profile. </para>
					<para>
						<code>urn:oasis:names:tc:dss-x:1.0:profiles:localsig:asynchronousprocessing
						</code>
					</para>
				</section>
				<section>
					<title>SignResponse</title>
					<para> This profile uses the following
						<code>&lt;dss:ResultMajor&gt;</code> code as defined in <xref
							linkend="dssAsync"/> to indicate that the operation did not finish yet. </para>
					<para>
						<code>urn:oasis:names:tc:dss:1.0:profiles:asynchronousprocessing:resultmajor:Pending
						</code>
					</para>
					<para> This profile uses the <code>&lt;async:CorrelationID&gt;</code>
						optional output element as defined in <xref linkend="dssAsync"/> as
						reference to the document that has been stored in the OASIS DSS server. </para>
				</section>
			</section>
			<section>
				<title>Signing</title>
				<para> This builds on <xref linkend="section-localsig-profile"/>. </para>
				<para> The <code>&lt;SignRequest&gt;</code> and
						<code>&lt;SignResponse&gt;</code> messages as defined in <xref
							linkend="section-profile-of-signing-protocol"/> SHALL include the document reference.
					This document reference is used to correlate the document transmitted via <xref
						linkend="section-prepare-signing"/> and the current User Agent session. </para>
				<section>
					<title>SignRequest</title>
					<para> Add an <code>&lt;dss:AdditionalProfile&gt;</code> element to the
						embedded <code>&lt;dss:SignRequest&gt;</code> containing the
						following URI to use this profile. </para>
					<para>
						<code>urn:oasis:names:tc:dss-x:1.0:profiles:localsig:asynchronousprocessing
						</code>
					</para>
					<para> This profile uses the optional input element
							<code>&lt;async:CorrelationID&gt;</code> as defined in <xref
							linkend="dssAsync"/> as reference to the document. </para>
				</section>
				<section>
					<title>SignResponse</title>
					<para> If the server returns the <code>&lt;dss:ResultMajor&gt;</code>
						code </para>
					<para>
						<code>urn:oasis:names:tc:dss:1.0:profiles:asynchronousprocessing:resultmajor:Pending
						</code>
					</para>
					<para> then the document signature was created successfully. In this case the
							<code>&lt;dss:SignResponse&gt;</code> within response message
						contains the optional output element
						<code>&lt;async:CorrelationID&gt;</code> as defined in <xref
							linkend="dssAsync"/>. </para>
				</section>
			</section>
			<section>
				<title>Finalize signing</title>
				<para>This section describes the request and response messages to finalize a signing
					operation. </para>
				<section>
					<title>SignRequest</title>
					<para> Add an <code>&lt;dss:AdditionalProfile&gt;</code> element
						containing the following URI to use this profile. </para>
					<para>
						<code>urn:oasis:names:tc:dss-x:1.0:profiles:localsig:asynchronousprocessing
						</code>
					</para>
					<para> This profile uses the optional input element
							<code>&lt;async:CorrelationID&gt;</code> as defined in <xref
							linkend="dssAsync"/> as reference to the document. </para>
				</section>
				<section>
					<title>SignResponse</title>
					<para>The response message contains the signed document.</para>
				</section>
			</section>
		</section>
		<section>
			<title>Original Document Verification Profile</title>
			<para> When the signing messages between the OASIS DSS and the relying party are passed via a
				User Agent, various additional attack vectors are possible. This profile can be used
				to provide the relying party additional means to verify whether no MITM attack
				occurred. </para>
			<para> We profile the OASIS DSS Verifying Protocol as defined in section 4 of <xref
					linkend="dssCore"/>. </para>
			<para> This profile can be used in combination with other profiles like <xref
					linkend="dssVerify"/>. </para>
			<section>
				<title>VerifyRequest</title>
				<para> Add an <code>&lt;dss:AdditionalProfile&gt;</code> element containing
					the following URI to use this profile. </para>
				<para>
					<code>urn:oasis:names:tc:dss-x:1.0:profiles:localsig:original-document </code>
				</para>
				<para> The <code>&lt;dss:Document&gt;</code> element MUST have an
					<code>ID</code> attribute to uniquely identify the document within a particular
					request message. </para>
				<para> The <code>&lt;OriginalDocument&gt;</code> optional input element
					contains an original document. Multiple
					<code>&lt;OriginalDocument&gt;</code> elements are allowed. The
						<code>&lt;OriginalDocument&gt;</code> element is of type
						<code>OriginalDocumentType</code> and contains the following attributes and
					elements. </para>
				<variablelist>
					<varlistentry>
						<term><code>WhichDocument</code> [Required] </term>
						<listitem>
							<para> A reference to the <code>&lt;dss:Document&gt;</code>
								element within the <code>&lt;dss:InputDocuments&gt;</code>
								element that contains the corresponding signed document. It is of
								type <code>xs:IDREF</code>. </para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term><code>&lt;dss:Document&gt;</code> [Required] </term>
						<listitem>
							<para> This element contains the original document. </para>
						</listitem>
					</varlistentry>
				</variablelist>
				<para>The schema for this element is listed below:
				<programlisting language="XML"><![CDATA[<element name="OriginalDocument" type="tns:OriginalDocumentType" />

<complexType name="OriginalDocumentType">
 <sequence>
  <element ref="dss:Document" />
 </sequence>
 <attribute name="WhichDocument" type="xs:IDREF" use="required" />
</complexType>
]]></programlisting></para>
			</section>
			<section>
				<title>VerifyResponse</title>
				<para> In case the service detected a mismatch between a signed document and the
					corresponding original document, the service returns a
						<code>&lt;dss:ResultMajor&gt;</code> of <code>RequesterError</code>
					and a <code>&lt;dss:ResultMinor&gt;</code> of: </para>
				<para>
					<code>urn:oasis:names:tc:dss-x:1.0:profiles:localsig:resultminor:changed-document
					</code>
				</para>
				<para> In case the <code>&lt;dss:VerifyResponse&gt;</code> contains a
					verification report as defined in <xref linkend="dssVerify"/> the above defined
					URI MAY be used as value for <code>&lt;dss:ResultMinor&gt;</code> within
					a <code>&lt;vr:IndividualReport&gt;</code> element. </para>
			</section>
		</section>
		<section>
			<title>Security Considerations</title>
			<para> Before deployment, each combination of profile, transport binding, and security
				binding SHOULD be analyzed for vulnerability in the context of the specific protocol
				exchange and the deployment environment. Below we illustrate some of the security
				concerns that often come up with protocols of this type, but we stress that this is
				not an exhaustive list of concerns. </para>
			<para> If a message defined under <xref linkend="section-profile-of-signing-protocol"/> is signed,
				the <code>Destination</code> XML attribute in the root OASIS DSS protocol mesage element
				MUST contain the URL to which the sender has instructed the User Agent to deliver
				the message. The recipient MUST then verify that the value matches the location at
				which the message has been received. </para>
			<para> As the OASIS DSS protocol defined in this document is similar to the SAML protocol most
				of the security considerations defined in <xref linkend="samlCore"/> also apply to
				the OASIS DSS protocol. </para>
			<para> As opposed to signatures created in the context of entity authentication,
				creation of document signatures using the OASIS DSS protocol yields additional attack
				vectors as the client may benefit to greater extent from manipulation of the to be
				signed document being transferred between relying party and OASIS DSS server. If the end
				user signs a different document as assumed by the relying party, the business impact
				could be huge. </para>
			<para> In the context of document signatures it is of eminent importance to even
				properly secure the OASIS DSS protocol request message that is transferred from relying
				party to the OASIS DSS server via the intermediate User Agent. This in order to avoid
				undetectable document manipulations by for example the end user. The <xref
					linkend="secure-conversation-security-binding"/> can ensure this. </para>
		</section>
		-->
	</section>

	<section id="conformance">
		<title>Conformance</title>
		<para>
			This profile defines the following conformance levels:
			<itemizedlist>
				<listitem>
					<para> Level A-1: Stateless </para>
				</listitem>
				<listitem>
					<para> Level A-2: Stateful</para>
				</listitem>
				<listitem>
					<para> Level B: Web </para>
				</listitem>
				<listitem>
					<para> Level C: Delegation </para>
				</listitem>
			</itemizedlist>	
			The conformance levels A, B and C are independent of each other.
		</para>
		<section id="conformance-stateless">
			<title>Level A-1: Stateless</title>
			<para>
				The conformance level 'Stateless' states that the Digital Signature Service cannot maintain state information between requests. 
			</para>
			<para>
				The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present with the value
				<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/two-step-approach</code></programlisting>
			</para>
			<para>
				It allows a client to obtain the document digest from an initial request. The initial request MUST contain the element <code>&lt;localsig:ReturnDocumentHash&gt;</code>; the attribute <code>MaintainRequestState</code>
				is either absent or has a value of <code>"false"</code>. The response MUST NOT contain the electronic signature or signed document nor the element <code>&lt;localsig:CorrelationID&gt;</code>; the response MUST contain the <code>&lt;dss:DocumentHash&gt;</code>.
			</para>
			<para>
				In the subsequent request the client MUST provide the document again and the <code>&lt;dss:SignatureObject&gt;</code> (and optionally,  the <code>&lt;dss:DocumentHash&gt;</code>); the element <code>&lt;localsig:CorrelationID&gt;</code>
				or <code>&lt;localsig:ReturnDocumentHash&gt;</code> MUST NOT be present. The response contains the electronic signature or signed document according to the SECOND request.
			</para>	
			<para>
				(The elements <code>&lt;localsig:ChallengeCode&gt;</code> or
				<code>&lt;localsig:ResponseCode&gt;</code> MUST NOT be used in the OptionalInputs.)
			</para>
		</section>
		
		<section id="conformance-stateful">
			<title>Level A-2: Stateful</title>
			<para>
				The conformance level 'Stateful' comprises all requirements of conformance Level A-1. In addition,  the conformance level states that the Digital Signature Service is able to maintain the state between two subsequent requests.
			</para>
			<para>
				The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present with the value
				<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/two-step-approach</code></programlisting>
			</para>
			<para>
				To make use of the stateful functionality, the initial request MUST contain the element  <code>&lt;localsig:ReturnDocumentHash&gt;</code> and the attribute <code>MaintainRequestState="true"</code> in the OptionaInputs.
				The response MUST contain a reference to the state, by means of the element <code>&lt;localsig:CorrelationID&gt;</code> and MUST provide the element <code>&lt;dss:DocumentHash&gt;</code>.
			</para>
			<para>
				In the subsequent request the client MUST provide the <code>&lt;dss:SignatureObject&gt;</code> as well as the element <code>&lt;localsig:CorrelationID&gt;</code> to refer to its previous request.
				The response contains the electronic signature or signed document according to the FIRST request.
			</para>	
		</section>
	
		<section id="conformance-web">
			<title>Level B: Web</title>
			<para>
				The conformance level 'Web' states that the Digital Signature Service is capable of using a HTTP User Agent and the HTTP User Agent is able to use the  (secure) signature-creation device to compute the
				digital signature value.
			</para>	
			<para>
				The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present with the value
				<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/user-agent</code></programlisting>
			</para>
			<para>
				The request follows the <xref linkend="dssCore"/> specification.
				The response contains the electronic signature or signed document according to the request, as defined by the <xref linkend="dssCore"/> specification.
			</para>
			<para>
				(The elements <code>&lt;localsig:ReturnDocumentHash&gt;</code>, <code>&lt;localsig:CorrelationID&gt;</code>, <code>&lt;localsig:ChallengeCode&gt;</code> or
				<code>&lt;localsig:ResponseCode&gt;</code> MUST NOT be used in the OptionalInputs or OptionalOutputs. 
				The element  <code>&lt;dss:SignatureObject&gt;</code> MUST NOT be used in the OptionalInputs.)
			</para>
		</section>

		<section id="conformance-delegation">
			<title>Level C: Third-Party</title>
			<para>
				The conformance level 'Third-Party' states that the Digital Signature Service is capable of delegating the signature creation to a third-party.
			</para>	
			<para>
				The element <code>&lt;dss:ServicePolicy&gt;</code> MUST be present in both requests with the value
				<programlisting><code>http://docs.oasis-open.org/dss-x/ns/localsig/delegation</code></programlisting>
			</para>
			<para>
				The request follows the <xref linkend="dssCore"/> specification. The element <code>&lt;localsig:ChallengeCode&gt;</code>, MUST be present and the element 
				<code>&lt;localsig:ResponseCode&gt;</code> MAY be present.
			</para>
			<para>
				The response contains the electronic signature or signed document according to the request, as defined by the <xref linkend="dssCore"/> specification.
			</para>
			<para>
				(The elements <code>&lt;localsig:ReturnDocumentHash&gt;</code>, <code>&lt;localsig:CorrelationID&gt;</code>, <code>&lt;dss:DocumentHash&gt;</code>,
				and  <code>&lt;dss:SignatureObject&gt;</code> MUST NOT be present in the OptionalInputs.
				The element<code>&lt;localsig:CorrelationID&gt;</code> MUST NOT be present in the OptionalOutputs.)
			</para>
			
		</section>
		
	</section>
	
	<appendix>
		<title>Normative Annex</title>
		<section id="schema">
			<title>Schema</title>
			<para>
				The new elements for the local signature profile are defined by the following XSD.
				<programlisting language="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
   xmlns:localsig="http://docs.oasis-open.org/dss-x/ns/localsig"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
   targetNamespace="http://docs.oasis-open.org/dss-x/ns/localsig"
   elementFormDefault="qualified" 
   attributeFormDefault="unqualified">
   <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" 
          schemaLocation="xmldsig-core-schema.xsd"/>
   <xs:element name="ReturnDocumentHash">
      <xs:complexType>
         <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" 
                   ref="ds:DigestMethod"/>
         </xs:sequence>
         <xs:attribute name="MaintainRequestState" 
                 use="optional" type="xs:boolean"/>
      </xs:complexType>
   </xs:element>
    <xs:element name="CorrelationID" type="xs:NCName"/>
    <xs:element name="ChallengeCode" type="xs:NCName"/>
    <xs:element name="ResponseCode" type="xs:NCName"/>
</xs:schema>
]]></programlisting>

			</para>
		</section>
	</appendix>
	<appendix role="non-normative">
		<title>Sample Application</title>
			<para>
				<xref linkend="fig-eid-dss-pipeline"/> shows the design of a digital signature
				service that uses the Belgian eID card as client signing token. </para>
			<figure id="fig-eid-dss-pipeline">
				<title>eID DSS Signature Pipeline</title>
				<mediaobject>
					<imageobject>
						<imagedata width="500" depth="200" align="center"
							fileref="eid-dss-pipeline.png" format="PNG"/>
					</imageobject>
				</mediaobject>
			</figure>
			<para> An end user enters the DSS signature pipeline via some protocol. First of all the
				appropriate protocol service parses the request. At this step the mime type of the
				incoming document is determined. Via the mime type the appropriate document service
				can be selected. The document service will first check the incoming document
				(syntax,...). Next the web browser capabilities are being queried in order for the
				document service to be able to correctly visualize the received document. After the
				user&apos;s consent the document service will orchestrate the document signing
				process using a web browser Java applet component. Finally the signed document is
				returned via the protocol service that also handled the incoming protocol request. </para>
			<para> The advantage of such a generic signature pipeline architecture is that one can
				easily add new document formats by providing a new document service implementation.
				Because the protocol handling is also isolated in protocol services, one can also
				easily add new DSS protocols to the platform. Another advantage of such a signature
				pipeline is that every Relying Party (RP), in the role of a DSS client, that uses the platform is guaranteed that the
				user followed a certain signature ceremony and is fully aware of the content of the
				signed document. This guarantee can be interesting from a legal point of view. </para>
			<para> A sample protocol flow is shown in <xref linkend="fig-simple-protocol"/>. </para>
			<figure id="fig-simple-protocol">
				<title>Sequence diagram of a simple protocol flow</title>
				<mediaobject>
					<imageobject>
						<imagedata depth="200" align="center" width="500" 
							fileref="simple-protocol.png" format="PNG"/>
					</imageobject>
				</mediaobject>
			</figure>
			<para> Here the client navigates via a web browser to the web application of the relying
				party. As part of the business work flow, the client fills in a web form. The
				relying party&apos;s web application converts the received form data into a
				document that needs to be signed by the client. Now the relying party&apos;s web
				application redirects the client web browser to the DSS web application. The DSS web
				application takes care of the signing ceremony using Java applet technology to
				connect to the client&apos;s token. Finally the DSS web application redirects
				the client&apos;s web browser back to the relying party. The relying party can
				now further process the signed document as part of the implemented business work
				flow. </para>
			<para> In such scenarios it is difficult to use the existing OASIS DSS protocol messages
				as is, because the OASIS DSS protocol does not provide the security mechanisms
				required to secure the communication between relying parties and the DSS in the
				context of web browsers. Various MITM attacks are possible at different points
				during the signature ceremony. Similar to the OASIS SAML Browser POST profile, we
				need to define additional wrapper messages to be able to guarantee secure
				transportation of the DSS requests and responses via web browsers. </para>
			<para> A disadvantage of the simple protocol shown is that the entire document is being
				transferred between relying party and DSS (and back) using the client&apos;s web
				browser. Given the upload limitation of most client&apos;s internet connection,
				this might result in a bad end user experience when trying to sign a large document.
				So additionally we should define some form of artifact binding. Here the relying
				party sends the to be signed document via a SOAP DSS web service to the DSS. The DSS
				stores the document in some temporary document repository. The relying party
				receives back a document identifier which it passes as parameter when redirecting
				the client&apos;s web browser towards the DSS. At the end of the protocol flow,
				the relying party can fetch the signed document from the DSS web service using the
				document identifier. </para>
	</appendix>
	<appendix role="non-normative">
		<title>Examples</title>
		<section id="Example-HTML-form">
			<title>User Agent</title>
			<section id="section-html-form-request">
				<title>Web Form of the SignRequest</title>
				<para>
					The client sends a request to the Digital Signature Service via the HTTP agent (a web browser) by means of a HTML form.
					<programlisting language="XML"><![CDATA[<html>
<head>SignRequest</head>
<body>
   <form
       id="dss-request-form" 
       method="post" 
       action="http://localsig.digitalsignatureservice.co.uk">
       <input type="hidden" name="signrequest" 
            value=
            "JVBERi0xLjYNJeLjz9MNCjI4IDAgb2JqDTw8L0ZpbHRlcid
             ZW5ndGggMTY1L04gMi9UeXBlL09ialN0bT4+c3RyZWFt
             i4GBiYFBiYEZTDKBSUZGRrlJUHEgR72YAQz+/wcAlBAG
             eHJlZgo3NjA0MQolJUVPRgo="/>
        <input type="hidden" name="clienturl" 
            value="http://localsig.digid.nl/654528644274424/"/>
   </form>
   <script type="text/javascript">
      document.getElementById('dss-request-form').submit();
   </script>
</body>
</html>]]></programlisting>
				</para>
			</section>
			<section id="section-html-form-response">
				<title>Web Form of the SignResponse</title>
				<para>
					The  Digital Signature Service sends the result back to the client, via the HTTP agent (a web browser, by using the URL of the client <code>http://localsig.digid.nl/654528644274424/</code> in the HTML form.
					The URL was provided in the request by the attribute <code>clienturl</code>.
					<programlisting language="XML"><![CDATA[<html>
<head>SignResponse</head>
<body>
   <form
       id="dss-response-form" 
       method="post" 
       action="http://localsig.digid.nl/654528644274424/">
       <input type="hidden" name="signresponse" 
            value=
            "eHJlZgo3NjA0MQolJUVPRgoDAgb2JqDTw8L0ZpbHRlcid
             i4GBiYFBiYEZTDKBSUZGRrlJUHEgR72YAQz+/wcAlBAG
             ZW5ndGggMTY1L04gMi9UeXBlL09ialN0bT4+c3RyZWFt
             JVBERi0xLjYNJeLjz9MNCjI4I="/>
   </form>
   <script type="text/javascript">
      document.getElementById('dss-response-form').submit();
   </script>
</body>
</html>]]></programlisting>
				</para>
			</section>
		</section>
		
		<section id="Example-Variant-1">
			<title>Two-Step Approach</title>
			<section id="section-initialrequest">
				<title>FIRST Request/Response</title>
				<para>
					The client application initiates a <code>&lt;dss:SignRequest&gt;</code> to request the digest of the document.
					<programlisting language="XML"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<dss:SignRequest 
    xmlns:dss="urn:oasis:names:tc:dss:1.0:core:schema"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
    xmlns:localsig="http://docs.oasis-open.org/dss-x/ns/localsig" 
    RequestID="example1-initial-request"
    Profile="http://docs.oasis-open.org/dss-x/ns/localsig">
    <dss:OptionalInputs>
        <dss:ServicePolicy>
            http://docs.oasis-open.org/dss-x/ns/localsig/two-step-approach
        </dss:ServicePolicy>
        <localsig:ReturnDocumentHash MaintainRequestState="true">
             <ds:DigestMethod 
                    Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
        </localsig:ReturnDocumentHash>
    </dss:OptionalInputs>
    <dss:InputDocuments>
        <dss:Document>
            <dss:Base64Data MimeType="application/pdf">
                JVBERi0xLjYNJeLjz9MNCjI4IDAgb2JqD
                [...]
                eHJlZgo3NjA0MQolJUVPRgo=
            </dss:Base64Data>
        </dss:Document>
    </dss:InputDocuments>
</dss:SignRequest>]]></programlisting>
				</para>
				<para>
					The <code>&lt;dss:SignResponse&gt;</code> contains the <code>&lt;localsig:CorrelationID&gt;</code> to be used in the subsequent <code>&lt;dss:SignRequest&gt;</code>.
					<programlisting language="XML"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<dss:SignResponse
    xmlns:dss="urn:oasis:names:tc:dss:1.0:core:schema"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:localsig="http://docs.oasis-open.org/dss-x/ns/localsig" 
    RequestID="example1-initial-request"
    Profile="http://docs.oasis-open.org/dss-x/ns/localsig">
    <dss:Result>
        <dss:ResultMajor>
             urn:oasis:names:tc:dss:1.0:resultmajor:Success
        </dss:ResultMajor>
        <dss:ResultMinor>
            urn:oasis:names:tc:dss:1.0:resultminor:documentHash
        </dss:ResultMinor>
    </dss:Result>
    <dss:OptionalOutputs>
        <localsig:CorrelationID>
            82962C67-F8D6-4480-A130-9280AB1F11A7
        </localsig:CorrelationID>
        <dss:DocumentHash>
            <dss:DocumentHash>
                <ds:DigestMethod 
                    Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>
                    In6GUzH+gMFR5q4WpUTyPa+1b4s=
                </ds:DigestValue>
            </dss:DocumentHash>
        </dss:DocumentHash>
    </dss:OptionalOutputs>
</dss:SignResponse>]]></programlisting>
				</para>
				<para>
					The client application uses the digest for the (secure) signature-creation device to obtain the signature.
				</para>
			</section>
			<section id="section-finalresponse">
				<title>SECOND Request/Response</title>
				<para>
					The client application initiates a <code>&lt;dss:SignRequest&gt;</code> to provide the Digital Signature Service with the signed digest (a <code>&lt;dss:SignatureObject&gt;</code> element) and request for the final document.
					<programlisting language="XML"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<dss:SignRequest
    xmlns:dss="urn:oasis:names:tc:dss:1.0:core:schema"
    xmlns:localsig="http://docs.oasis-open.org/dss-x/ns/localsig" 
    RequestID="example1-final-request"
    Profile="http://docs.oasis-open.org/dss-x/ns/localsig">
    <dss:OptionalInputs>
        <dss:ServicePolicy>
            http://docs.oasis-open.org/dss-x/ns/localsig/two-step-approach
        </dss:ServicePolicy>
        <localsig:CorrelationID>
            82962C67-F8D6-4480-A130-9280AB1F11A7
        </localsig:CorrelationID>
        <dss:SignatureObject>
            <dss:Base64Signature>
                MIAGCSqGSIb3DQEHAqCAMIIRdQIBATE
                DQEHAaCCD74wggWAMIIEaKADAgECAg
                [...]
                DQEBAQUABEA3YkuiPSDVaAhaAza49UT
                DZWtCGVc0LCc5QRlBOc54ZrVGp6AA==
            </dss:Base64Signature>
        </dss:SignatureObject>
    </dss:OptionalInputs>
</dss:SignRequest>]]></programlisting>
				</para>
				<para>
					The final <code>&lt;dss:SignResponse&gt;</code> contains the signed document.
					<programlisting language="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<dss:SignResponse
    xmlns:dss="urn:oasis:names:tc:dss:1.0:core:schema"
    RequestID="example1-final-request"
    Profile="http://docs.oasis-open.org/dss-x/ns/localsig" >
    <dss:Result>
        <dss:ResultMajor>
        urn:oasis:names:tc:dss:1.0:resultmajor:Success
        </dss:ResultMajor>
        <dss:ResultMinor>
     urn:oasis:names:tc:dss:1.0:resultminor:valid:signature:OnAllDocuments
        </dss:ResultMinor>
        <dss:ResultMessage lang="en-us"/>
    </dss:Result>
    <dss:OptionalOutputs>
        <dss:DocumentWithSignature>
            <dss:Document>
                <dss:Base64Data MimeType="application/pdf">
                  JVBERi0xLjYNJeLjz9MNCjI4IDAgb2JqDTw
                  [...]
                  qmMAg///AYYzCwcKZW5kc3RyZWFtCmVCg==
                </dss:Base64Data>
            </dss:Document>
        </dss:DocumentWithSignature>
    </dss:OptionalOutputs>
</dss:SignResponse>]]></programlisting>
				</para>
			</section>
		</section>

	</appendix>
	
	<appendix role="non-normative">
		<title>Acknowledgements</title>
		<para>The following persons have participated in the creation of this specification and are gratefully acknowledged (in alphabetical order):</para>
		<itemizedlist spacing="compact">
			<listitem><para> Andreas Kuehne, Individual.</para></listitem>
			<listitem><para> Detlef Huehnlein, Individual.</para></listitem>
			<listitem><para> Ernst Jan van Nigtevecht, Sonnenglanz Consulting BV.</para></listitem>
			<listitem><para> Ezer Farhi, ARX</para></listitem>
			<listitem><para> Frank Cornelis, Fedict</para></listitem>
			<listitem><para> Juan Carlos Cruellas, Departamento de Arquitectura de Computadores, Univ Politecnica de Cataluna.</para></listitem>
			<listitem><para> Oscar Burgos, CATCert-Agencia Catalana de Certificacio.</para></listitem>
			<listitem><para> Pim van der Eijk, Sonnenglanz Consulting BV.</para></listitem>
			<listitem><para> Stefan Drees, Individual.</para></listitem>
		</itemizedlist>		
	</appendix>
	
	<appendix id="a.revhistory" role="non-normative">
		<title>Revision History</title>
		<para>
			<revhistory>
				<revision>
					<revnumber>0.1</revnumber>
					<date>13 Januari 2014</date>
					<authorinitials>E.J. Van Nigtevecht</authorinitials>
					<revremark>Creation of the CSD 01 based on the WD 06.</revremark>
				</revision>

			</revhistory>
		</para>
	</appendix>
</article>
