Codeunit SignedXml
Provides a functionality to singing an xml document.
Properties
| Name | Value |
|---|---|
| Access | Public |
| InherentEntitlements | X |
| InherentPermissions | X |
Methods
InitializeSignedXml
Initializes a new instance of the SignedXml class from the specified XML document.
procedure InitializeSignedXml(SigningXmlDocument: XmlDocument)
Parameters
| Name | Type | Description |
|---|---|---|
| SigningXmlDocument | XmlDocument |
The XmlDocument object to use to initialize the new instance of SignedXml. |
InitializeSignedXml
Initializes a new instance of the SignedXml class from the specified XmlElement object.
procedure InitializeSignedXml(SigningXmlElement: XmlElement)
Parameters
| Name | Type | Description |
|---|---|---|
| SigningXmlElement | XmlElement |
The XmlElement object to use to initialize the new instance of SignedXml. |
SetSigningKey
Sets the key used for signing a SignedXml object.
procedure SetSigningKey(XmlString: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| XmlString | Text |
The XML string containing key information. |
SetSigningKey
Sets the key used for signing a SignedXml object.
procedure SetSigningKey(XmlString: Text, SignatureAlgorithm: Enum SignatureAlgorithm)
Parameters
| Name | Type | Description |
|---|---|---|
| XmlString | Text |
The XML string containing key information. |
| SignatureAlgorithm | Enum System.Security.Encryption.SignatureAlgorithm |
The type of asymmetric algorithms. |
SetSigningKey
Sets the key used for signing a SignedXml object.
procedure SetSigningKey(XmlString: SecretText)
Parameters
| Name | Type | Description |
|---|---|---|
| XmlString | SecretText |
The XML string containing key information. |
SetSigningKey
Sets the key used for signing a SignedXml object.
procedure SetSigningKey(XmlString: SecretText, SignatureAlgorithm: Enum SignatureAlgorithm)
Parameters
| Name | Type | Description |
|---|---|---|
| XmlString | SecretText |
The XML string containing key information. |
| SignatureAlgorithm | Enum System.Security.Encryption.SignatureAlgorithm |
The type of asymmetric algorithms. |
SetSigningKey
Sets the key used for signing a SignedXml object.
procedure SetSigningKey(SignatureKey: Codeunit "Signature Key")
Parameters
| Name | Type | Description |
|---|---|---|
| SignatureKey | Codeunit System.Security.Encryption."Signature Key" |
The key used for signing the SignedXml object. |
InitializeReference
Initializes a new instance of the Reference class with the specified Uri.
procedure InitializeReference(Uri: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| Uri | Text |
The Uri with which to initialize the new instance of Reference. |
SetDigestMethod
Sets the digest method Uniform Resource Identifier (URI) of the current Reference.
procedure SetDigestMethod(DigestMethod: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| DigestMethod | Text |
The digest method URI of the current Reference. The default value is http://www.w3.org/2001/04/xmlenc#sha256. |
AddXmlDsigC14NTransformToReference
Adds a XmlDsigC14NTransform object to the list of transforms to be performed on the data before passing it to the digest algorithm.
procedure AddXmlDsigC14NTransformToReference(IncludeComments: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| IncludeComments | Boolean |
AddXmlDsigExcC14NTransformToReference
Adds a XmlDsigExcC14NTransform object to the list of transforms to be performed on the data before passing it to the digest algorithm.
procedure AddXmlDsigExcC14NTransformToReference(InclusiveNamespacesPrefixList: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| InclusiveNamespacesPrefixList | Text |
A string that contains namespace prefixes to canonicalize using the standard canonicalization algorithm. |
SetCanonicalizationMethod
Sets the canonicalization algorithm that is used before signing for the current SignedInfo object.
procedure SetCanonicalizationMethod(CanonicalizationMethod: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| CanonicalizationMethod | Text |
The canonicalization algorithm used before signing for the current SignedInfo object. |
SetXmlDsigExcC14NTransformAsCanonicalizationMethod
Sets the XmlDsigExcC14NTransform as canonicalization algorithm that is used before signing for the current SignedInfo object.
procedure SetXmlDsigExcC14NTransformAsCanonicalizationMethod(InclusiveNamespacesPrefixList: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| InclusiveNamespacesPrefixList | Text |
A string that contains namespace prefixes to canonicalize using the standard canonicalization algorithm. |
SetSignatureMethod
Sets the name of the algorithm used for signature generation and validation for the current SignedInfo object.
procedure SetSignatureMethod(SignatureMethod: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| SignatureMethod | Text |
The name of the algorithm used for signature generation and validation for the current SignedInfo object. |
InitializeKeyInfo
Initializes a new instance of the KeyInfo class.
procedure InitializeKeyInfo()
AddClause
Adds a xml element of KeyInfoNode to the collection of KeyInfoClause.
procedure AddClause(KeyInfoNodeXmlElement: XmlElement)
Parameters
| Name | Type | Description |
|---|---|---|
| KeyInfoNodeXmlElement | XmlElement |
The xml element of KeyInfoNode to add to the collection of KeyInfoClause. |
AddKeyInfoClauseFromX509Certificate
Adds key information from an X509 certificate to the collection of KeyInfoClause.
procedure AddKeyInfoClauseFromX509Certificate(X509CertBase64Value: Text, CertPassword: SecretText)
Parameters
| Name | Type | Description |
|---|---|---|
| X509CertBase64Value | Text |
The X509Certificate2 in Base64 format that contains the public key information to be added to KeyInfoClause. |
| CertPassword | SecretText |
The password for the X509Certificate2. |
LoadXml
Loads a SignedXml state from an XML element.
procedure LoadXml(SignatureElement: XmlElement)
Parameters
| Name | Type | Description |
|---|---|---|
| SignatureElement | XmlElement |
The XML element to load the SignedXml state from. |
InitializeDataObject
Initializes a new instance of the DataObject class.
procedure InitializeDataObject()
AddObject
Adds a xml element of DataObject object to the list of objects to be signed.
procedure AddObject(DataObjectXmlElement: XmlElement)
Parameters
| Name | Type | Description |
|---|---|---|
| DataObjectXmlElement | XmlElement |
The xml element of DataObject to add to the list of objects to be signed. |
AddXmlDsigExcC14NTransformToReference
Adds a AddXmlDsigExcC14NTransformToReference object to the list of transforms to be performed on the data before passing it to the digest algorithm.
procedure AddXmlDsigExcC14NTransformToReference()
AddXmlDsigEnvelopedSignatureTransform
Adds a AddXmlDsigEnvelopedSignatureTransform object to the list of transforms to be performed on the data before passing it to the digest algorithm.
procedure AddXmlDsigEnvelopedSignatureTransform()
AddReferenceToSignedXML
Adds a Reference object to the Signed XML and clears Reference object.
procedure AddReferenceToSignedXML()
ComputeSignature
Computes an Xml digital signature from Xml document.
procedure ComputeSignature()
CheckSignature
Determines whether the signature verifies using the public key in the signature.
procedure CheckSignature(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
true if the signature verifies; otherwise, false. |
CheckSignature
Determines whether the Signature property verifies for the specified key.
procedure CheckSignature(XmlString: SecretText): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| XmlString | SecretText |
The XML string containing key information. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the signature verifies; otherwise, false. |
CheckSignature
Determines whether the signature verifies for the specified X509Certificate2 and, optionally, whether the certificate is valid.
procedure CheckSignature(X509CertBase64Value: Text, X509CertPassword: SecretText, VerifySignatureOnly: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| X509CertBase64Value | Text |
The X509Certificate2 in Base64 format to use to verify the signature. |
| X509CertPassword | SecretText |
The password to the X509Certificate2. |
| VerifySignatureOnly | Boolean |
true to verify the signature only; false to verify both the signature and certificate. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the signature verifies; otherwise, false. |
GetXml
Returns the Xml representation of a signature.
procedure GetXml(): XmlElement
Returns
| Type | Description |
|---|---|
| XmlElement |
The Xml representation of the signature. |
GetXmlDsigDSAUrl
Represents the Uniform Resource Identifier (URI) for the standard DSA algorithm for XML digital signatures.
procedure GetXmlDsigDSAUrl(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2000/09/xmldsig#dsa-sha1. |
GetXmlDsigC14NTransformUrl
Represents the Uniform Resource Identifier (URI) for canonical XML form.
procedure GetXmlDsigC14NTransformUrl(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
GetXmlDsigExcC14NTransformUrl
Represents the Uniform Resource Identifier (URI) for exclusive XML canonicalization.
procedure GetXmlDsigExcC14NTransformUrl(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2001/10/xml-exc-c14n#. |
GetXmlDsigHMACSHA1Url
Represents the Uniform Resource Identifier (URI) for the standard HMACSHA1 algorithm for XML digital signatures.
procedure GetXmlDsigHMACSHA1Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2000/09/xmldsig#hmac-sha1. |
GetXmlDsigRSASHA1Url
Represents the Uniform Resource Identifier (URI) for the standard RSA signature method for XML digital signatures.
procedure GetXmlDsigRSASHA1Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2000/09/xmldsig#rsa-sha1. |
GetXmlDsigRSASHA256Url
Represents the Uniform Resource Identifier (URI) for the RSA SHA-256 signature method variation for XML digital signatures.
procedure GetXmlDsigRSASHA256Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2001/04/xmldsig-more#rsa-sha256. |
GetXmlDsigRSASHA384Url
Represents the Uniform Resource Identifier (URI) for the RSA SHA-384 signature method variation for XML digital signatures.
procedure GetXmlDsigRSASHA384Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2001/04/xmldsig-more#rsa-sha384. |
GetXmlDsigRSASHA512Url
Represents the Uniform Resource Identifier (URI) for the RSA SHA-512 signature method variation for XML digital signatures.
procedure GetXmlDsigRSASHA512Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2001/04/xmldsig-more#rsa-sha512. |
GetXmlDsigSHA1Url
Represents the Uniform Resource Identifier (URI) for the standard SHA1 digest method for XML digital signatures.
procedure GetXmlDsigSHA1Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2000/09/xmldsig#sha1. |
GetXmlDsigSHA256Url
Represents the Uniform Resource Identifier (URI) for the standard SHA256 digest method for XML digital signatures.
procedure GetXmlDsigSHA256Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2001/04/xmlenc#sha256. |
GetXmlDsigSHA384Url
Represents the Uniform Resource Identifier (URI) for the standard SHA384 digest method for XML digital signatures.
procedure GetXmlDsigSHA384Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
GetXmlDsigSHA512Url
Represents the Uniform Resource Identifier (URI) for the standard SHA512 digest method for XML digital signatures.
procedure GetXmlDsigSHA512Url(): Text[250]
Returns
| Type | Description |
|---|---|
| Text[250] |
The value http://www.w3.org/2001/04/xmlenc#sha512. |