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 Windows / Funciones varias de Windows
  • Operating mode
  • Required configuration
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
OpenSSLCheck (Function)
Checks, via a public key, that the signature of data performed with the OpenSSL library is correct.
Caution: This function only verifies signatures in RSA + SHA1 format.. To manage additional formats, use CertificateCheckString.
Ejemplo
sPublicKey is string = [
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDi8S01w2xZzE00dzSEaoFqsOuv
WFRHqwnSYXRV9pazpLMRW6M8mFBow7CwVNI26JTU0pXopOGTf0dHVwR8i/AS/mYi
3YdmSkeFJ5PTtOqupr1OWW9GjIciDzyg12CJyH59UoG3anNC8Zy3LfG8bpoUxb/E
9V+5yUZz4akdeNpU7wIDAQAB
-----END PUBLIC KEY-----
]

sData is string = [
Date 08/31/2012
Order #123456
-----------------------------------
1 Leather armchair: € 125.90
6 Fish plates: € 54.99
-----------------------------------
TOTAL: €180.89
]

sDataSignedDatabase64 is string = [
wmn3lM4anUpdhUyBkarlYQK7Ftzf7dA6HOoSlZUilsk9YxNooV8nOyRrMq8eCIWY
5h3J7noxhkkhEMz0TWpen0FCYE57jHwDTKTLtmIIQONKZPTD2vKJgc8wifejm0jH
zSsRhRm8o2iqfPuSSSZlXxoPWLihKmU3NqlNqIFUwx4=

]

IF OpenSSLCheck(sData, sDataSignedDatabase64, sPublicKey) THEN
	Info("The signature is correct")
ELSE
	Info("The signature is incorrect")
END
// Check the signature of data transmitted by PayBox
sData is string = [
amount=500&ref=634762387633462156_1329&auto=XXXXXX&
trans=405476423&error=00000&transid=406494010&subscription=0
		]
Signature is string = [
npArYMsKpBYQ3XFyouN32Q1Z5/HxEpXCiYrjks6ZQD8RPFfoJ4hEVnm1WD7tDCvEkS
awAfyaN3jUG7tHjc3NR1gnjoZREz3LSjsr128GUGmRZpF1uV3vG6NqHzWf2TiZMUtt
QH8yMBBb6XsIv1I5h6S0K6EZzt2SB4dp7AfyHR0=
		]
sPublicKey is string = [
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe+hkicNP7ROHUssGNtHwiT2Ew
HFrSk/qwrcq8v5metRtTTFPE/nmzSkRnTs3GMpi57rBdxBBJW5W9cpNyGUh0jNXc
VrOSClpD5Ri2hER/GcNrxVRP7RlWOqB1C03q4QYmwjHZ+zlM4OUhCCAtSWflB4wC
Ka1g88CjFwRw/PB9kwIDAQAB
-----END PUBLIC KEY-----
]

// Check 
IF OpenSSLCheck(Data, Signature, sPublicKey) THEN
	Info("The signature is correct")
ELSE
	Info("The signature is incorrect")
END

// Note: Verification is also possible with the CertificateCheckString function using 
// the certSignatureOnly + certSHA160 constants
// Useful in Linux, iOS and Android
Sintaxis
<Result> = OpenSSLCheck(<Data> , <Signature> , <Key>)
<Result>: Boolean
  • True if the signature is correct,
  • False otherwise.
<Data>: Character string
Signed data.
<Signature>: Character string
Signature of data (encoded in Base64 format)
<Key>: Character string or Secret string
Public key corresponding to the private key that was used to encrypt the data.
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 o Unicode string".
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
Observaciones

Operating mode

The OpenSSL library is used by several sites for secure payment, like PayBox, to certify the requests between the business site and the payment site.
OpenSSLCheck allows you to easily control encryption keys that have been generated with the OpenSSL cryptography library.
For PayBox, the data and the signature are returned by PayBox. The public key can be easily found on the PayBox site. It is also possible to use CertificateCheckString by first decoding the signature that is encoded in base64url with Decode. CertificateCheckString works on Windows, Linux, iOS and Android while OpenSSLCheck only works on Windows.
PHP

Required configuration

In PHP, the openssl module must be enabled.
To enable (if necessary) this library locally, the PHP.INI file found in the Windows directory must include the "extension=php_openssl.dll" line (instead of ";extension=php_openssl.dll").
Componente: wd300std.dll
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: 16/05/2025

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