Skip to main content

mbedtls_pkcs7_signed_data_verify

Function mbedtls_pkcs7_signed_data_verify 

Source
pub unsafe extern "C" fn mbedtls_pkcs7_signed_data_verify(
    pkcs7: *mut mbedtls_pkcs7,
    cert: *const mbedtls_x509_crt,
    data: *const c_uchar,
    datalen: usize,
) -> c_int
Expand description

\brief Verification of PKCS #7 signature against a caller-supplied certificate.

            For each signer in the PKCS structure, this function computes
            a signature over the supplied data, using the supplied
            certificate and the same digest algorithm as specified by the
            signer. It then compares this signature against the
            signer's signature; verification succeeds if any comparison
            matches.

            This function does not use the certificates held within the
            PKCS #7 structure itself, and does not check that the
            certificate is signed by a trusted certification authority.

\param pkcs7 mbedtls_pkcs7 structure containing signature. \param cert Certificate containing key to verify signature. \param data Plain data on which signature has to be verified. \param datalen Length of the data.

\note This function internally calculates the hash on the supplied plain data for signature verification.

\return 0 if the signature verifies, or a negative error code on failure.