ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Certificate functions
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
Extracts a certificate from a signature buffer or from a print duplicate.
Example
// Extract a certificate from the buffer
MyCertificate is Certificate
MyCertificate = CertificateExtract(buffSignature, certificateFromBuffer)
 
// Checks whether the signature does not correspond
// or whether the buffer is incorrect (details in ErrorInfo)
IF MyCertificate = Null THEN
Error("Error while retrieving the certificate." + CR + ErrorInfo())
RETURN
END
 
// Displays the trust level of the certificate
SWITCH MyCertificate.Reliability
CASE certificateOk: Info("Valid certificate")
CASE certificateInvalid: Info("Invalid certificate")
CASE certificateUntrusted: Info("Trust root of certificate not reliable")
CASE certificateExpired: Info("Expired validation dates of certificate")
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: 05/26/2022

Send a report | Local help