XMLSigner Class
Properties Methods Events Configuration Settings Errors
The XMLSigner class provides a simple interface for digitally signing XML data according to the XML-Signature Syntax and Processing specification.
Syntax
XMLSigner
Remarks
To sign the data, you need to specify the data to be signed using the References property, then select the signature type and signature method type (signature or MAC).
Set the path to the file to be signed via the InputFile. Signed data will be saved in the OutputFile. Finally, call the Sign method to generate a signature and save signed data. It is possible to generate a signature remotely: use SignExternal method to do this.
Asynchronous signing is also supported. Call SignAsyncBegin to generate a signature and save the generated XML-DSIG without signature value into the document. To complete the signing, call SignAsyncEnd.
XMLSigner only performs basic signing of XML documents. For richer features, such as XAdES and/or chain validation, please see the XAdESSigner class
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
CanonicalizationMethod | Specifies XML canonicalization method to use. |
Encoding | Specifies XML encoding. |
ExternalCryptoCustomParams | Custom parameters to be passed to the signing service (uninterpreted). |
ExternalCryptoData | Additional data to be included in the async state and mirrored back by the requestor. |
ExternalCryptoExternalHashCalculation | Specifies whether the message hash is to be calculated at the external endpoint. |
ExternalCryptoHashAlgorithm | Specifies the request's signature hash algorithm. |
ExternalCryptoKeyID | The ID of the pre-shared key used for DC request authentication. |
ExternalCryptoKeySecret | The pre-shared key used for DC request authentication. |
ExternalCryptoMethod | Specifies the asynchronous signing method. |
ExternalCryptoMode | Specifies the external cryptography mode. |
ExternalCryptoPublicKeyAlgorithm | Provide public key algorithm here if the certificate is not available on the pre-signing stage. |
HashAlgorithm | Specifies the hash algorithm to be used. |
InputBytes | Use this property to pass the input to class in the byte array form. |
InputFile | Specifies the XML document to be signed. |
OutputBytes | Use this property to read the output the class object has produced. |
OutputFile | A file where the signed document is to be saved. |
ReferenceCount | The number of records in the Reference arrays. |
ReferenceAutoGenerateElementId | Specifies whether the identifier (ID) attribute for a referenced (target) element should be auto-generated during signing. |
ReferenceCanonicalizationMethod | Use this property to specify the canonicalization method for the transform of the reference. |
ReferenceCustomElementId | Specifies a custom identifier (ID) attribute for a referenced (target) element that will be set on signing. |
ReferenceDigestValue | Use this property to get or set the value of the digest calculated over the referenced data. |
ReferenceHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
ReferenceHashAlgorithm | Specifies the hash algorithm to be used. |
ReferenceHasURI | Specifies whether the URI is set (even when it is empty). |
ReferenceID | A user-defined identifier (ID) attribute of this Reference element. |
ReferenceInclusiveNamespacesPrefixList | Use this property to specify InclusiveNamespaces PrefixList for exclusive canonicalization transform of the reference. |
ReferenceReferenceType | The Reference's type attribute as defined in XMLDSIG specification. |
ReferenceTargetData | Contains the referenced external data when the digest value is not explicitly specified. |
ReferenceTargetXMLElement | This property specifies the referenced XML element. |
ReferenceURI | Use this property to get or set the URL which references the data. |
ReferenceUseBase64Transform | Specifies whether Base64 transform is included in transform chain. |
ReferenceUseEnvelopedSignatureTransform | Specifies whether enveloped signature transform is included in transform chain. |
ReferenceUseXPathFilter2Transform | Specifies whether XPath Filter 2. |
ReferenceUseXPathTransform | Specifies whether XPath transform is included in transform chain. |
ReferenceXPathExpression | Use this property to specify XPath expression for XPath transform of the reference. |
ReferenceXPathFilter2Expressions | Use this property to specify XPointer expression(s) for XPath Filter 2. |
ReferenceXPathFilter2Filters | Use this property to specify XPointer filter(s) for XPath Filter 2. |
ReferenceXPathFilter2PrefixList | Use this property to specify a prefix list for XPath Filter 2. |
ReferenceXPathPrefixList | Use this property to specify a prefix list for XPath transform of the reference. |
SignatureType | The signature type to employ when signing the document. |
SigningCertBytes | Returns raw certificate data in DER format. |
SigningCertHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
SigningChainCount | The number of records in the SigningChain arrays. |
SigningChainBytes | Returns raw certificate data in DER format. |
SigningChainHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
XMLElement | Specifies the XML element where to save the signature data. |
NamespaceCount | The number of records in the Namespace arrays. |
NamespacePrefix | A user-defined prefix value of a namespace. |
NamespaceURI | A user-defined URI value of a namespace. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
AddDataReference | Creates a new XML reference to the specified data. |
AddReference | Creates a new XML reference to the specified XML element. |
Config | Sets or retrieves a configuration setting. |
ExtractAsyncData | Extracts user data from the DC signing service response. |
Sign | Signs an XML document. |
SignAsyncBegin | Initiates the asynchronous signing operation. |
SignAsyncEnd | Completes the asynchronous signing operation. |
SignExternal | Signs the document using an external signing facility. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Reports the details of signing errors. |
ExternalSign | Handles remote or external signing initiated by the SignExternal method or other source. |
FormatElement | Reports the XML element that is currently being processed. |
FormatText | Reports XML text that is currently being processed. |
Notification | This event notifies the application about an underlying control flow event. |
ResolveReference | Asks the application to resolve a reference. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
DetachedResourceURI | Specifies a detached resource URI. |
EnvelopingObjectEncoding | Specifies the enveloping object encoding. |
EnvelopingObjectID | Specifies the enveloping object identifier. |
EnvelopingObjectMimeType | Specifies the enveloping object MIME type. |
ExclusiveCanonicalizationPrefix | Specifies the exclusive canonicalization prefix. |
HMACKey | The key value for HMAC. |
HMACOutputLength | TBD. |
IDAttributeName | Specifies the custom name of ID attribute. |
IDAttributeNamespaceURI | Specifies the custom namespace URI of ID attribute. |
IncludeKey | Specifies whether to include the signing key to the signature. |
IncludeKeyValue | Specifies whether the key value must be included to the signature. |
InclusiveNamespacesPrefixList | Specifies the InclusiveNamespaces PrefixList. |
InputType | Specifies the Input type. |
KeyInfoCustomXML | The custom XML content for KeyInfo element. |
KeyInfoDetails | Specifies the signing key info details to include to the signature. |
KeyInfoID | Specifies the ID for KeyInfo element. |
KeyName | Contains information about the key used for signing. |
ManifestCount | The number of the manifest elements. |
ManifestID[Index] | The ID of the manifest element. |
ManifestObjectIndex[Index] | The object element index to which the manifest element belongs. |
ManifestXML[Index] | The XML content of the manifest element. |
ObjectCount | The number of the object elements. |
ObjectEncoding[Index] | The Encoding of the object element. |
ObjectID[Index] | The ID of the object element. |
ObjectMimeType[Index] | The MIME type of the object element. |
ObjectXML[Index] | The XML content of the object element. |
SignatureCompliance | Specifies the signature compliance mode. |
SignatureID | Specifies the ID for Signature element. |
SignaturePrefix | Specifies the signature prefix. |
SignaturePropertiesCount | The number of the signature properties elements. |
SignaturePropertiesID[Index] | The ID of the signature properties element. |
SignaturePropertiesObjectIndex[Index] | The object element index to which the signature properties element belongs. |
SignaturePropertiesXML[Index] | The XML content of the signature properties element. |
SignaturePropertyCount | The number of the signature property elements. |
SignaturePropertyID[Index] | The ID of the signature properties element. |
SignaturePropertyPropertiesIndex[Index] | The signature properties element index to which the signature property element belongs. |
SignaturePropertyTarget[Index] | The Target of the signature properties element. |
SignaturePropertyXML[Index] | The XML content of the signature property element. |
SignatureValue | Contains the SignatureValue. |
SignatureValueID | Specifies the ID for SignatureValue element. |
SignedInfoID | Specifies the ID for SignedInfo element. |
TempPath | Location where the temporary files are stored. |
UseHMACSigning | Whether to use HMAC signing. |
UsePSS | Whether to use RSASSA-PSS algorithm. |
WriteBOM | Specifies whether byte-order mark should be written when saving the document. |
XMLFormatting | Specifies the signature XML formatting. |
CheckKeyIntegrityBeforeUse | Enables or disable private key integrity check before use. |
CookieCaching | Specifies whether a cookie cache should be used for HTTP(S) transports. |
Cookies | Gets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only). |
DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
LogDestination | Specifies the debug log destination. |
LogDetails | Specifies the debug log details to dump. |
LogFile | Specifies the debug log filename. |
LogFilters | Specifies the debug log filters. |
LogFlushMode | Specifies the log flush mode. |
LogLevel | Specifies the debug log level. |
LogMaxEventCount | Specifies the maximum number of events to cache before further action is taken. |
LogRotationMode | Specifies the log rotation mode. |
MaxASN1BufferLength | Specifies the maximal allowed length for ASN.1 primitive tag data. |
MaxASN1TreeDepth | Specifies the maximal depth for processed ASN.1 trees. |
OCSPHashAlgorithm | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
UseOwnDNSResolver | Specifies whether the client classes should use own DNS resolver. |
UseSharedSystemStorages | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
UseSystemRandom | Enables or disables the use of the OS PRNG. |