ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous Windows functions
  • Operating mode
  • Required configuration
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
OpenSSLCheck (Function)
In french: OpenSSLVérifie
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.
Example
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
Syntax
<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.
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 or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
Remarks

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").
Component: wd300std.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/23/2024

Send a report | Local help