PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Operating mode
  • Required configuration
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
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=
]
Key is string = "-----BEGIN PUBLIC KEY-----" + CR + ...
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe+hkicNP7ROHUssGNtHwiT2Ew" + CR + ...
"HFrSk/qwrcq8v5metRtTTFPE/nmzSkRnTs3GMpi57rBdxBBJW5W9cpNyGUh0jNXc" + CR + ...
"VrOSClpD5Ri2hER/GcNrxVRP7RlWOqB1C03q4QYmwjHZ+zlM4OUhCCAtSWflB4wC" + CR + ...
"Ka1g88CjFwRw/PB9kwIDAQAB" + CR + "-----END PUBLIC KEY-----"

IF OpenSSLCheck(sData, Signature, Key) THEN
Info("The signature is correct")
ELSE
Info("The signature is incorrect")
END
Syntax
<Result> = OpenSSLCheck(<Data> , <Signature> , <Key>)
<Result>: Boolean
  • True if the signature is correct,
  • False otherwise.
<Data>: Character string (with quotes)
Signed data.
<Signature>: Character string (with quotes)
Signature of data (encoded in Base64 format)
<Key>: Character string (with quotes)
Public key corresponding to the private key that was used to encrypt the data.
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 is used to easily check the encrypted keys with the OpenSSL encryption library.
For PayBox, the data and the signature are returned by PayBox. The public key can be easily found on the PayBox site.
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").
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment