AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos XML
  • Properties specific to xmlSignature variables
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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.
Ejemplo
MySignature is xmlSignature
MySignature.AlgorithmNormalization = atC14NExclusiveWithComments
MySignature.AlgorithmSignature = 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.AlgorithmNormalization = atC14NExclusive
cMySignature.AlgorithmSignature = 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)
Propiedades

Properties specific to xmlSignature variables

The following properties can be used to define the characteristics of xmlSignature variables:
Property nameType usedEffect
AlgorithmNormalizationInteger constantMethod for standardizing the XML (C14N):
  • atAucune: no standardization method.
  • atC14N11Inclusive: C14N11 inclusive standardization method.
  • atC14N11IncludedWithComment: C14N11 inclusive standardization method with comments.
  • atC14NExclu: Exclusive C14N standardization method.
  • atC14NExcluAvecComment: Exclusive C14N standardization method with comments.
  • atC14NInclusive: C14N inclusive standardization method.
  • atC14NIncludedWithComment: C14N inclusive standardization method with comments.
AlgorithmSignatureInteger constantMethod used for the signature:
  • asDSA_SHA_160: DSA encryption algorithm and SHA 160 hash algorithm.
  • asECDSA_SHA_224: ECDSA encryption algorithm and SHA 224 hash algorithm.
  • asECDSA_SHA_256: ECDSA encryption algorithm and SHA 256 hash algorithm.
  • asECDSA_SHA_384: ECDSA encryption algorithm and SHA 384 hash algorithm.
  • asECDSA_SHA_512: ECDSA encryption algorithm and SHA 512 hash algorithm.
  • asRSA_SHA_160: RSA encryption algorithm and SHA 160 hash algorithm.
  • asRSA_SHA_256: RSA encryption algorithm and SHA 256 hash algorithm.
  • asRSA_SHA_384: RSA encryption algorithm and SHA 384 hash algorithm.
  • asRSA_SHA_512: RSA encryption algorithm and SHA 512 hash algorithm.
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, the certificate handled may be a certificate present on a smart card.
    Attention This feature is only available in WINDEV Suite SaaS 2025 Update 1. For more details, see Using new features exclusive to WINDEV 2025 SaaS.
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: DER (Distinguished Encoding Rule) encoding.
  • tfcPEM: PEM-type encoding.
  • tfcPKCS12: PKCS12-type 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.
Novedad versión 2025
Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro debe ser "ANSI string - Latin".
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
AndroidWidget Android Las cadenas secretas no están disponibles para este parámetro en aplicaciones Android y widgets de Android.
ReferenceArray of xmlSignatureReferenceElements to sign.
Versión mínima requerida
  • Versión 18
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 07/02/2025

Señalar un error o enviar una sugerencia | Ayuda local