PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
CertificateSignExecutable (Function)
In french: CertificatSigneExécutable
Signs an executable file with a certificate. The signature is included in the file.
Example
// Open the certificate picker of Windows
MyCertificate is Certificate
MyCertificate = CertificateSelect()
 
// Cancelation or error
IF MyCertificate = Null THEN
RETURN
END
 
// If the selected certificate is valid for signing
IF NOT MyCertificate.ValidForSignature THEN
Info("The selected certificate cannot be used to generate a signature.")
RETURN
END
 
// Retrieve the buffer containing the signature
IF NOT CertificateSignExecutable(sFullFileName, MyCertificate) THEN
Error("Error while signing the certificate:" + CR + ErrorInfo())
END
Syntax
<Result> = CertificateSignExecutable(<Executable> , <Certificate> [, <Description> [, <Algorithm>]])
<Result>: Boolean
  • True if the executable was signed,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Executable>: Character string
Full name of executable file to sign.
<Certificate>: Certificate variable
Name of the variable of type Certificate that contains the certificate to be used to sign the executable.
<Description>: Optional character string
Text displayed by the UAC window when running the executable.
<Algorithm>: Integer constant
Hash algorithm used by the signature:
certSHA160
(Default value)
Algorithm also known as SHA1.
certSHA256Algorithm also known as SHA2.
Remark: This algorithm is not supported in Windows Vista. The UAC does not display any information and the executable can be run.
Business / UI classification: Business Logic
Component: wd280std.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment