X509CertCmsVerify (FUN)

FUNCTION X509CertCmsVerify : RTS_IEC_RESULT

Verifies a CMS signature. This function can handle both (detached and attached) signatures. The signers certificate has to be located in the CMS container. Otherwise the verify will fail. The signers certificate is always verified against the trusted certificate store on the PLC.

InOut:

Scope

Name

Type

Comment

Return

X509CertCmsVerify

RTS_IEC_RESULT

ERR_OK if the signature is valid and the signer was trustworthy. ERR_SIGNATURE_MISMATCH if the signature is invalid and / or the signer was not trustworthy. ERR_PARAMETER if the given parameters are not consistent.

Input

hCertStore

RTS_IEC_HANDLE

Handle to the certificate store.

pCms

POINTER TO RtsByteString

Pointer to a byte string storing the CMS container.

encoding

RtsCertEncoding

Encoding of the CMS container.

pInData

POINTER TO RtsByteString

Used only if the signature is detached. In this case this byte string has to store the data to be verified

pOutData

POINTER TO RtsByteString

Pointer to a byte string where to store the extracted data.