PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Validity of certificate
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
Creates the signature of a file. This signature can be stored in a Buffer variable or in a text file.
Example
WINDEVUser code (UMC)
MonCertificat is Certificate
 
// Ouverture du sélecteur de certificat de Windows
MonCertificat = CertificateSelect()
 
// Annulation ou erreur
IF MonCertificat.Name = "" THEN
RETURN
END
 
// Teste si le certificat sélectionné est pas valide pour signer
IF MonCertificat.ValidForSignature = False THEN
Info("Le certificat sélectionné ne permet de pas de générer une signature.")
RETURN
END
 
// Récupération du buffer contenant la signature
bufSignature is Buffer
bufSignature = CertificateSignFile(NomCompletFichier, MonCertificat)
 
// Sauvegarde de la signature dans un fichier pour une vérification ultérieure
fSaveBuffer(MonFichierDeSignature, bufSignature)
Syntax
<Result> = CertificateSignFile(<File path> , <Certificate> [, <Signature file>])
<Result>: Buffer
Signature of the file. This buffer can be used later by CertificateCheckBufferSignatureFile to check the correspondence between the signature and the file.
<File path>: Character string (with quotes)
Name and full (or relative) path of the file for which a signature will be created.
<Certificate>: Certificate variable
Name of Certificate variable containing the certificate that will be used to create the signature of the file.
<Signature file>: Optional character string (with quotes)
Name and full (or relative) path of the file containing the signature. This file can be used later by CertificateCheckFileSignatureFile to check the correspondence between the signature and the file.
Remarks

Validity of certificate

Before signing a file, it is advisable to check the validity of the Certificate (Property ValidForSignature of the Variable type Certificate). This property is used to find out whether the certificate owns a private key as well as all the characteristics required to perform a signature. CertificateSignFile returns an error if this property is set to False.
Component: wd260std.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment