Skip to main content
Version: 7.2405.x.x LTS

X509Certificate object methods

getFingerPrint()

Returns the fingerprint of the certificate as a string

local cert = req:getPeerCertificate(true)

if cert then
local fingerPrint = cert:getFingerPrint()
end

getSubjectDN()

Returns the distinguished name of the certificate as a string

local cert = req:getPeerCertificate(true)

if cert then
local subjectDN = cert:getSubjectDN()
end

isValid()

Returns 'true' if the certificate is already and still valid. Returns 'false' if the certificate is either not yet valid or if it has expired.

local cert = req:getPeerCertificate(true)

if cert then
local isValid = cert:isValid()
end

getAsPem()

Returns a string of the certificate in PEM format

local cert = req:getPeerCertificate(true)

if cert then
local pem = cert:getAsPem()
end