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 / Certificate functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Loads a certificate from a file or from a buffer.
Example
// Chargement à partir d'un fichier
tabCertificat is array of Certificate
MonCertificat is Certificate

tabCertificat = CertificateLoad("MonCertificat.cer", "MonMotDePasse")
MonCertificat = tabCertificat[1]
Syntax

Loading the certificate from a file Hide the details

<Result> = CertificateLoad(<Certificate file> , <Password>)
<Result>: Array of Certificates
Array of Certificate variables containing the loaded certificates.
<Certificate file>: Character string
Path of file containing the certificate to load.
This file can contain:
  • a PKCS#12 certificate of the "Public-Key Cryptography Standards" family. These files usually have a ".p12", ".cer" or ".crt" extension.
  • a certificate in PFX format (predecessor to the PKCS#12 format). These files usually have a ".pfx" extension.
Note: If the certificate path is not specified, the certificate will be searched for in the project library..
<Password>: Character string or Secret string
Certificate password.
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.

Loading the certificate from a buffer Hide the details

<Result> = CertificateLoad(<Buffer> , <Password>)
<Result>: Array of Certificates
Array of Certificate variables containing the loaded certificates.
<Buffer>: Buffer variable
Buffer containing the certificate data.
<Password>: Character string or Secret string
Certificate password.
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
  • The certificate does not have to be found in the Windows store.
  • This function can be used to load the certificate used by SocketConnectSSL and NotifPushSend.
    tabCertificat is array of Certificate
    cerCertificatClient is Certificate
    //------------------ Certificat client
    tabCertificat = CertificateLoad("Certificat_client.p12", PASS_CERTIF)
    IF ErrorOccurred _OR_ tabCertificat.Count < 1 THEN
    	Error("Pas de certificat client " + ErrorInfo(errMessage))
    	RETURN
    END
    // Certificat client
    cerCertificatClient = tabCertificat[tabCertificat.Occurence]
    
    // Il est possible de faire des vérifications supplémentaires sur le certificat
    // en manipulant directement la variable cerCertificatClient
    
    //------------------ Connexion
    IF NOT SocketConnectSSL(sNomConnexion, nNumPort, sAdresseServeur, 
    		ProtocolTLS1_2 + ProtocolTLS1_3, 5 s,cerCertificatClient) THEN
    	Error("Echec de la connexion au serveur [%sAdresseServeur%] sur le port [%nNumPort%]", 
    			ErrorInfo())
    	RETURN
    END
    Trace("Serveur trouvé")
    // Suite du code
  • The certificate can be included in the project library (WDL file).
Component: wd300std.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/16/2025

Send a report | Local help