ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XML file functions
  • Properties specific to xmlSignature variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The xmlSignature type is used to define the advanced characteristics of an XML signature. You can define and change the characteristics of this signature using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
MySignature is xmlSignature
MySignature.NormalizationAlgorithm = atC14NExclusiveWithComments
MySignature.SignatureAlgorithm = saRSA_SHA_160
MySignature.Key = MyCertificate
Add(MySignature.Reference, myReference)
MySignature.KeyInformation[1].Type = informationKeyX509
// Example that uses a web service included to the project
// This example does not work via a copy/paste

// SOAPAddXMLSignature takes in 2nd parameter the location where the signature will be placed.
// This location is described in the WSDL that we want to use, by an XSD type.
// In this code example, this location is described in "Security.Assetion.Signature"
// that comes from the WSDL of the web service that we want to call.

// Therefore, we must refer to the WSDL that we are using to find this location.

MyRequest is wsRequest
MySecurity is Security // web service included in the project. 

// Builds an identifier
id is string = GetGUID(guidFormatted)
id = "_" + Middle(id, 2, Length(id) - 2)

// Initializes the signature
cMySignature is xmlSignature
cMySignature.NormalizationAlgorithm = atC14NExclusive
cMySignature.SignatureAlgorithm = saRSA_SHA_256
// Key file OR certificate retrieved by the certificate functions
cMySignature.Key = fExeDir + fSep + "mykey.p12"
cMySignature.KeyPassword = "password"
cMySignature.KeyFileType = tfcPKCS12
cMySignature.Reference[1].HashAlgorithm = HA_SHA_256
cMySignature.Reference[1].URI = "#" + id
cMySignature.Reference[1].Transformation[1] = atEnveloped
cMySignature.Reference[1].Transformation[2] = atC14NExclusive
x509 is xmlSignatureInformationKeyX509
x509.WithCertificate = True
cMySignature.KeyInformation[1] = x509

// End of signature initialization
dtCurrentDateTime is DateTime
MySecurity.Assertion:ID = id
MySecurity.Assertion:IssueInstant = dtCurrentDateTime
MySecurity.Assertion:Version = "2.0"
MySecurity.Assertion.Issuer = "test"
MaSecurity.Assertion.Issuer:Format = ...
	"urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"

// Adds the signature
SOAPAddXMLSignature(MaRequest, MySecurity.Assertion.Signature, cMySignature)
Properties

Properties specific to xmlSignature variables

The following properties can be used to define the characteristics of xmlSignature variables:
Property nameType usedEffect
KeyCertificate or key file used for the signature.
  • If this property corresponds to a file, the KeyFileType property must be specified.
  • New in SaaS
    If this property corresponds to a variable of type Certificate, you can use a certificate present on a smart card.
    Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 1. For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
KeyFileTypeInteger constantIf the Key property corresponds to a file, the KeyFileType property is used to define the type of file encoding:
  • tfcBinary: Binary encoding.
  • tfcDER: Distinguished Encoding Rule (DER) encoding.
  • tfcPEM: PEM encoding.
  • tfcPKCS12: PKCS12 encoding.
  • tfcPKCS8DER: PKCS8 DER encoding.
  • tfcPKCS8PEM: PKCS8 PEM encoding.
KeyInformationArray of xmlSignatureInformationKeyX509 variablesUsed to specify information about the key used.
KeyPasswordCharacter string or Secret stringPassword used to decrypt the private key.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI string - Latin".
To learn more about secret strings and how to use the vault, see Secret string vault.
New in version 2025
AndroidAndroid Widget Secret strings are not available for this parameter in Android/Android widget applications.
NormalizationAlgorithmInteger constantXML canonicalization method (C14N):
  • atNone: No canonicalization method.
  • atC14N11Inclusive: C14N11 inclusive canonicalization.
  • atC14N11InclusiveWithComments: C14N11 inclusive canonicalization with comments.
  • atC14NExclusive: C14N exclusive canonicalization.
  • atC14NExclusiveWithComments: C14N exclusive canonicalization with comments.
  • atC14NInclusive: C14N inclusive canonicalization.
  • atC14NInclusiveWithComments: C14N inclusive canonicalization with comments.
ReferenceArray of xmlSignatureReferenceElements to sign.
SignatureAlgorithmInteger constantMethod used for the signature:
  • saDSA_SHA_160: Digital Signature Algorithm (DSA) and SHA-160.
  • saECDSA_SHA_224: Elliptic Curve Digital Signature Algorithm (ECDSA) and SHA-224.
  • saECDSA_SHA_256: Elliptic Curve Digital Signature Algorithm (ECDSA) and SHA-256.
  • saECDSA_SHA_384: Elliptic Curve Digital Signature Algorithm (ECDSA) and SHA-384.
  • saECDSA_SHA_512: Elliptic Curve Digital Signature Algorithm (ECDSA) and SHA-512.
  • saRSA_SHA_160: RSA encryption algorithm and SHA-160.
  • saRSA_SHA_256: RSA encryption algorithm and SHA-256.
  • saRSA_SHA_384: RSA encryption algorithm and SHA-384.
  • saRSA_SHA_512: RSA encryption algorithm and SHA-512.
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/27/2025

Send a report | Local help