PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Managing certificates in WEBDEV
  • Limits
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
Checks the correspondence between a signature and a string.
Versions 23 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 23
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Example
WINDEVReports and QueriesUser code (UMC)
MyCertificate is Certificate

// Open the certificate picker of Windows
MyCertificate = CertificateSelect()

// Cancelation or error
IF MyCertificate..Name = "" THEN
RETURN
END

// Checks whether the selected certificate is valid for signing
IF MyCertificate..ValidForSignature = False THEN
Info("The selected certificate cannot be used to generate a signature.")
RETURN
END

// Retrieve the buffer containing the signature
bufSignature is Buffer
bufSignature = CertificateSignString("Character string to sign", MyCertificate)

// Check the signature
SWITCH CertificateCheckString("Character string to sign", bufSignature)
CASE certificateOk: Info("Valid signature and trusted certificate")
CASE certificateInvalid: Info("Invalid signature or certificate")
CASE certificateExpired: Info("Valid signature but expired certificate")
CASE certificateUntrusted: Info("Valid signature but root confidence " + ...
"of certificate not reliable")
END
Syntax
WINDEVWEBDEV - Server codeReports and QueriesLinuxUser code (UMC)

Checking the correspondence between a signature and a string Hide the details

<Result> = CertificateCheckString(<String to Check> , <Signature Buffer>)
<Result>: Integer constant
Result of signature check:
certificateExpiredValid signature but expired certificate.
certificateInvalidInvalid signature or certificate.
certificateUntrustedValid signature but untrusted certificate root.
certificateOkTrusted signature and certificate.
<String to Check>: Character string (with quotes)
Character string on which the check will be performed.
<Signature Buffer>: Buffer
Buffer containing the signature of the string. This buffer is returned by CertificateSignString.
Versions 22 and later
Syntax available via the module dated July 28, 2017Syntax available via Update 5 only
New in version 22
Syntax available via the module dated July 28, 2017Syntax available via Update 5 only
Syntax available via the module dated July 28, 2017Syntax available via Update 5 only

Checking the correspondence between a signature and a string (numeric signature) Hide the details

<Result> = CertificateCheckString(<String to Check> , <Signature Buffer> , <Certificate File> [, <Password> [, <Trusted Authorities>]] , <Options>)
<Result>: Integer constant
Result of signature check:
certificateExpiredValid signature but expired certificate.
certificateInvalidInvalid signature or certificate.
certificateUntrustedValid signature but untrusted certificate root.
certificateOkTrusted signature and certificate.
<String to Check>: Character string (with quotes)
Character string on which the check will be performed.
<Signature Buffer>: Buffer
Buffer containing the signature of the string. This buffer is returned by CertificateSignString.
<Certificate File>: Character string (with quotes)
Full path of certificate file to use (in PEM, DER or P12 format).
  • For a PKCS7 signature, this file allows you to add certificates used to search for trusted string.
  • for the rough signature, this file contains the public key.
<Password>: Character string (with quotes)
Versions 23 and later
Password that will be used to decrypt the certificate file if this one is password protected.
Note: This parameter is useful if the certificate used is identical to the one used for the signature.
New in version 23
Password that will be used to decrypt the certificate file if this one is password protected.
Note: This parameter is useful if the certificate used is identical to the one used for the signature.
Password that will be used to decrypt the certificate file if this one is password protected.
Note: This parameter is useful if the certificate used is identical to the one used for the signature.
<Trusted Authorities>: Character string (with quotes) or array of strings
Versions 23 and later
Full path of trusted certificate to use.
This parameter can also correspond to an array of strings containing the full path of different trusted certificates to use.
AndroidAndroid Widget Caution: This parameter is required in the recent systems (Android 2.6 and later).
New in version 23
Full path of trusted certificate to use.
This parameter can also correspond to an array of strings containing the full path of different trusted certificates to use.
AndroidAndroid Widget Caution: This parameter is required in the recent systems (Android 2.6 and later).
Full path of trusted certificate to use.
This parameter can also correspond to an array of strings containing the full path of different trusted certificates to use.
AndroidAndroid Widget Caution: This parameter is required in the recent systems (Android 2.6 and later).
<Options>: Integer constant (or combination of constants)
Signature format:
certPKCS7Signature in PKCS7 format.
certSignatureOnlySignature only. In this case, the certSignatureOnly constant must be combined with the hashing algorithm:
  • certSignatureOnly + certMD5: MD5 algorithm.
  • certSignatureOnly + certSHA160: SHA1 algorithm.
  • certSignatureOnly + certSHA256: SHA2 algorithm. A 256-bit result is produced.
  • certSignatureOnly + certSHA384: SHA-384 algorithm. A 384-bit result is produced
  • certSignatureOnly + certSHA512: SHA-512 algorithm. A 512-bit result is produced.
In this case, the trusted string is not checked. Only the validity of signature in relation to the public key is checked.
Remarks
WEBDEV - Server code

Managing certificates in WEBDEV

In order for the certificates to be visible to the site user, they must be installed on the server in the store of custom certificates of the Internet user.
AndroidAndroid Widget

Limits

This function is available for the devices equipped with ARM processors. A fatal error occurs if this function is used with devices not equipped with ARM processors (x86, mips, ...). This function is available for the devices equipped with ARM processors or using an ARM emulation. Otherwise (and on the Samsung Galaxy Tab 3 tablet), a fatal error will occur.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment