ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV and WEBDEV 2025 feature!
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
CertificateExport (Function)
In french: CertificatExporte
Exports a certificate from a certificate store to a "pfx" or "cert" file.
Example
arrCertificates is array of Certificate = CertificateList()

FOR EACH ACertificate OF arrCertificates
	SWITCH ACertificate.EndValidityDate
		CASE <= Now():
			Error("The [%ACertificate.Name%] certificate (serial number [%ACertificate..SerialNumber%]) is expired")
			BREAK SWITCH
		CASE <= (Now() - 7 d):
			Error("The [%ACertificate.Name%] certificate (serial number [%ACertificate..SerialNumber%]) expires in less than 7 days.")
			BREAK SWITCH
		OTHER CASE
			CONTINUE
	END
	// Export expired certificates
	// and send them to the network administrator by email 
	// so that they can determine which certificate to renew
	sExportedCertificatePath is string
	sExportedCertificatePath = CertificateExport(ACertificate, ACertificate.Password, fExeDir() / "Certificate")
	// Send certificate to network administrator
	// ...
	fDelete(sExportedCertificatePath)
END
Syntax
<Result> = CertificateExport(<Certificate> , <Password> , <Backup file>)
<Result>: Character string
Full name of exported file, with extension.
<Certificate>: Certificate variable
Name of the Certificate variable containing the description of the certificate to be exported.
<Password>: Character string or Secret string
Private key password required to export the certificate.
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.
<Backup file>: Character string
Full name of the certificate export file. Do not indicate the file extension. This extension will be added when the certificate is exported. If the certificate has a private key, it will be exported to a pfx file. Otherwise, it will be exported to a cert file.
Business / UI classification: Business Logic
Component: wd300std.dll
Minimum version required
  • Version 2025
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/06/2024

Send a report | Local help