* '''SignedInfo''' contains or references the signed data and lists algorithm information
The {{Code|generate-signature}} function allows to pass a {{Code|digital certificate}}. This certificate holds parameters that allow to access key information stored in a Java key store which is then used to sign the input document. Passing a {{Code|digital certificate}} simply helps re-using the same key pair to sign and validate data. The {{Code|digital certificate}} is passed as a node and has the following form:
<syntaxhighlight pre lang="xml">
<digital-certificate>
<keystore-type>JKS</keystore-type>
<keystore-uri>...</keystore-uri>
</digital-certificate>
</syntaxhighlightpre>
==crypto:generate-signature==
{| width='100%'
|- valign="top"
| width='120' | '''SignaturesSignature'''
|<pre>crypto:generate-signature(
$input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $ext1 as item(), $ext2 as node()
) as node()</pre>
{{Func|crypto:generate-signature|$input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $ext1 as item()|node()}}<br/>
{{Func|crypto:generate-signature|$input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $ext1 as item(), $ext2 as node()|node()}}
|{{Error|CX0015|#Errors}} the signature element cannot be found.<br/>{{Error|CX9994|#Errors}} an unspecified problem occurs during validation.<br/>{{Error|CX9996|#Errors}} an IO exception occurs during validation.<br/>
|- valign="top"
| '''Example'''
|Validate [https://www.w3.org/TR/xmldsig-core/ XML Signature]:
'''Query:'''
<syntaxhighlight lang="xquery">
let $sig := crypto:generate-signature(<a/>, '', '', '', '', '')