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
Extracts a certificate from a signature buffer or from a print duplicate.
Example
// Extraction du certificat depuis le buffer
MonCertificat is Certificate 
MonCertificat = CertificateExtract(bufSignature, certificateFromBuffer)

// Teste si la signature ne correspond pas 
// ou si le buffer est incorrect (détail dans ErreurInfo)
IF MonCertificat = Null THEN
	Error("Erreur lors de la récupération du certificat." + CR + ErrorInfo())
	RETURN
END

// Affiche le niveau de fiabilité du certificat
SWITCH MonCertificat.Reliability
	CASE certificateOk: Info("Certificat valide")
	CASE certificateInvalid: Info("Certificat invalide")
	CASE certificateUntrusted: Info("Racine de confiance du certificat non fiable")
	CASE certificateExpired: Info("Dates de validité du certificat expiré")
END
Syntax
<Result> = CertificateExtract(<Signed Element> [, <Option>])
<Result>: Certificate variable
Certificate variable extracted from the element containing the signature.
<Signed Element>: Buffer variable or character string
Corresponds to:
<Option>: Optional Integer constant
Specifies the type of element used:
certificateFromBuffer
(Default value)
The element is a signature buffer.
certificateFromDuplicateThe element is the path of a signed duplicate file.
Component: wd300std.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Exemplo CertificateExtract
MyExtractedCertificate is Certificate
HReset(CERTIFICADO)
IF HReadSeek(CERTIFICADO,AGRONOMO_ID,EDT_AGRONOMO_ID,hIdentical) = True THEN

EDT_CertificadoEncodado = CERTIFICADO.CERTIFICADO_ENCODE

bufSignature is Buffer = Decode(CERTIFICADO.CERTIFICADO_ENCODE,encodeBASE64)

MyExtractedCertificate = CertificateExtract(bufSignature,certificateFromBuffer)

IF MyExtractedCertificate = Null THEN
RESULT False
END

IF MyExtractedCertificate..EndValidityDate<DateSys() THEN
Info("Certificado Vencido")
else

MySignature is pdfSignature
MySignature..Certificate = MyExtractedCertificate
MySignature..Caption = " por:" + MyExtractedCertificate..Name + " em " + DateToString(DateSys())
MySignature..Height = 264 //xAlturaTexto
MySignature..Width = 167 //xLarguraTexto
MySignature..X = 1 //xPosicaoTextoX
MySignature..Y = 15 //xPosicaoTextoY
MySignature..VerticalAlignment=iBottom
MySignature..HorizontalAlignment=iRight
END


end
Boller
03 Feb. 2023

Last update: 09/21/2024

Send a report | Local help