SecureBlackbox 2020 Node.js Edition

Questions / Feedback?

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

secureblackbox.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.

CanonicalizationMethodSpecifies XML canonicalization method to use.
EncodingSpecifies XML encoding.
ExternalCryptoCustomParamsCustom parameters to be passed to the signing service (uninterpreted).
ExternalCryptoDataAdditional data to be included in the async state and mirrored back by the requestor.
ExternalCryptoExternalHashCalculationSpecifies whether the message hash is to be calculated at the external endpoint.
ExternalCryptoHashAlgorithmSpecifies the request's signature hash algorithm.
ExternalCryptoKeyIDThe ID of the pre-shared key used for DC request authentication.
ExternalCryptoKeySecretThe pre-shared key used for DC request authentication.
ExternalCryptoMethodSpecifies the asynchronous signing method.
ExternalCryptoModeSpecifies the external cryptography mode.
ExternalCryptoPublicKeyAlgorithmProvide public key algorithm here if the certificate is not available on the pre-signing stage.
HashAlgorithmSpecifies the hash algorithm to be used.
InputBytesUse this property to pass the input to class in the byte array form.
InputFileSpecifies the XML document to be signed.
OutputBytesUse this property to read the output the class object has produced.
OutputFileA file where the signed document is to be saved.
ReferenceCountThe number of records in the Reference arrays.
ReferenceAutoGenerateElementIdSpecifies whether the identifier (ID) attribute for a referenced (target) element should be auto-generated during signing.
ReferenceCanonicalizationMethodUse this property to specify the canonicalization method for the transform of the reference.
ReferenceCustomElementIdSpecifies a custom identifier (ID) attribute for a referenced (target) element that will be set on signing.
ReferenceDigestValueUse this property to get or set the value of the digest calculated over the referenced data.
ReferenceHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
ReferenceHashAlgorithmSpecifies the hash algorithm to be used.
ReferenceHasURISpecifies whether the URI is set (even when it is empty).
ReferenceIDA user-defined identifier (ID) attribute of this Reference element.
ReferenceInclusiveNamespacesPrefixListUse this property to specify InclusiveNamespaces PrefixList for exclusive canonicalization transform of the reference.
ReferenceReferenceTypeThe Reference's type attribute as defined in XMLDSIG specification.
ReferenceTargetDataContains the referenced external data when the digest value is not explicitly specified.
ReferenceTargetXMLElementThis property specifies the referenced XML element.
ReferenceURIUse this property to get or set the URL which references the data.
ReferenceUseBase64TransformSpecifies whether Base64 transform is included in transform chain.
ReferenceUseEnvelopedSignatureTransformSpecifies whether enveloped signature transform is included in transform chain.
ReferenceUseXPathFilter2TransformSpecifies whether XPath Filter 2.
ReferenceUseXPathTransformSpecifies whether XPath transform is included in transform chain.
ReferenceXPathExpressionUse this property to specify XPath expression for XPath transform of the reference.
ReferenceXPathFilter2ExpressionsUse this property to specify XPointer expression(s) for XPath Filter 2.
ReferenceXPathFilter2FiltersUse this property to specify XPointer filter(s) for XPath Filter 2.
ReferenceXPathFilter2PrefixListUse this property to specify a prefix list for XPath Filter 2.
ReferenceXPathPrefixListUse this property to specify a prefix list for XPath transform of the reference.
SignatureTypeThe signature type to employ when signing the document.
SigningCertBytesReturns raw certificate data in DER format.
SigningCertHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
SigningChainCountThe number of records in the SigningChain arrays.
SigningChainBytesReturns raw certificate data in DER format.
SigningChainHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
XMLElementSpecifies the XML element where to save the signature data.
NamespaceCountThe number of records in the Namespace arrays.
NamespacePrefixA user-defined prefix value of a namespace.
NamespaceURIA 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.

AddDataReferenceCreates a new XML reference to the specified data.
AddReferenceCreates a new XML reference to the specified XML element.
ConfigSets or retrieves a configuration setting.
ExtractAsyncDataExtracts user data from the DC signing service response.
SignSigns an XML document.
SignAsyncBeginInitiates the asynchronous signing operation.
SignAsyncEndCompletes the asynchronous signing operation.
SignExternalSigns 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.

ErrorReports the details of signing errors.
ExternalSignHandles remote or external signing initiated by the SignExternal method or other source.
FormatElementReports the XML element that is currently being processed.
FormatTextReports XML text that is currently being processed.
NotificationThis event notifies the application about an underlying control flow event.
ResolveReferenceAsks 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.

DetachedResourceURISpecifies a detached resource URI.
EnvelopingObjectEncodingSpecifies the enveloping object encoding.
EnvelopingObjectIDSpecifies the enveloping object identifier.
EnvelopingObjectMimeTypeSpecifies the enveloping object MIME type.
ExclusiveCanonicalizationPrefixSpecifies the exclusive canonicalization prefix.
HMACKeyThe key value for HMAC.
HMACOutputLengthTBD.
IDAttributeNameSpecifies the custom name of ID attribute.
IDAttributeNamespaceURISpecifies the custom namespace URI of ID attribute.
IncludeKeySpecifies whether to include the signing key to the signature.
IncludeKeyValueSpecifies whether the key value must be included to the signature.
InclusiveNamespacesPrefixListSpecifies the InclusiveNamespaces PrefixList.
InputTypeSpecifies the Input type.
KeyInfoCustomXMLThe custom XML content for KeyInfo element.
KeyInfoDetailsSpecifies the signing key info details to include to the signature.
KeyInfoIDSpecifies the ID for KeyInfo element.
KeyNameContains information about the key used for signing.
ManifestCountThe 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.
ObjectCountThe 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.
SignatureComplianceSpecifies the signature compliance mode.
SignatureIDSpecifies the ID for Signature element.
SignaturePrefixSpecifies the signature prefix.
SignaturePropertiesCountThe 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.
SignaturePropertyCountThe 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.
SignatureValueContains the SignatureValue.
SignatureValueIDSpecifies the ID for SignatureValue element.
SignedInfoIDSpecifies the ID for SignedInfo element.
TempPathLocation where the temporary files are stored.
UseHMACSigningWhether to use HMAC signing.
UsePSSWhether to use RSASSA-PSS algorithm.
WriteBOMSpecifies whether byte-order mark should be written when saving the document.
XMLFormattingSpecifies the signature XML formatting.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client classes should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 Node.js Edition - Version 20.0 [Build 8165]