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 / Comunicación / SOAP
  • Propiedades específicas de las variables xmlSignature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
xmlSignature (tipo Variable)
 
El tipo xmlSignature define las características avanzadas de una firma XML. Puede definir y cambiar las características de esta firma utilizando diferentes propiedades de WLanguage.
Observación: Para obtener más información sobre la declaración de este tipo de variable y el uso de propiedades WLanguage, consulte Declarar una variable.
Ejemplo
MySignature is xmlSignature
MySignature.AlgorithmNormalization = atC14NExclusiveWithComments
MySignature.AlgorithmSignature = asRSA_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].AlgorithmHash = 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)
Observaciones

Propiedades específicas de las variables xmlSignature

Las siguientes propiedades utilizan variables de tipo xmlSignature:
Nombre de la propiedadTipo utilizadoEfecto
AlgorithmNormalizationConstante de tipo IntegerMétodo de estandarización del XML (C14N):
  • atNone: no hay método de estandarización.
  • atC14N11Inclusive: Método de estandarización C14N11 incluido.
  • atC14N11InclusiveWithComments: Incluye el método de estandarización C14N11 con comentarios.
  • atC14NExclusive: Método exclusivo de estandarización C14N.
  • atC14NExclusiveWithComments: Método exclusivo de estandarización C14N con comentarios.
  • atC14NInclusive: Método de estandarización C14N incluido.
  • atC14NInclusiveWithComments: Incluye el método de estandarización C14N con comentarios.
AlgorithmSignatureConstante de tipo IntegerMétodo utilizado para la firma:
  • comoDSA_SHA_160: Algoritmo de encriptación DSA y algoritmo hash SHA 160
  • comoRSA_SHA_160: Algoritmo de encriptación RSA y algoritmo hash SHA 160
  • comoRSA_SHA_256: Algoritmo de encriptación RSA y algoritmo SHA 256 hash
ClaveCertificate o archivo clave utilizado para la firma. Si este Property corresponde a un archivo, se debe especificar el KeyFileType Property .
KeyFileTypeConstante de tipo IntegerSi la propiedad Key corresponde a un archivo, la propiedad KeyFileType permite definir el tipo de codificación del archivo:
  • tfcBinary: binario encoding.
  • tfcDER: DER encoding (Regla Distinguida encoding).
  • tfcPEM: PEM encoding.
  • tfcPKCS12: PKCS12 encoding.
  • tfcPKCS8DER: PKCS8 DE encoding.
  • tfcPKCS8PEM: PKCS8 PEM encoding.
KeyInformationArray de variables de tipo xmlSignatureInformationKeyX509Se utiliza para especificar la información sobre la clave utilizada.
KeyPasswordCadena de caracteresContraseña utilizada para descifrar la clave private.
referenceArray de xmlSignatureReferenceElementos para firmar.
Ver también
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: 01/02/2024

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