| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
@deftypefun {int} {gnutls_pkcs7_verify_direct} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_crt_t @var{signer}, unsigned @var{idx}, const gnutls_datum_t * @var{data}, unsigned @var{flags}) |
| 6 |
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t} type |
| 7 |
|
| 8 |
@var{signer}: the certificate believed to have signed the structure |
| 9 |
|
| 10 |
@var{idx}: the index of the signature info to check |
| 11 |
|
| 12 |
@var{data}: The data to be verified or @code{NULL} |
| 13 |
|
| 14 |
@var{flags}: Zero or an OR list of @code{gnutls_certificate_verify_flags} |
| 15 |
|
| 16 |
This function will verify the provided data against the signature |
| 17 |
present in the SignedData of the PKCS @code{7} structure. If the data |
| 18 |
provided are NULL then the data in the encapsulatedContent field |
| 19 |
will be used instead. |
| 20 |
|
| 21 |
Note that, unlike @code{gnutls_pkcs7_verify()} this function does not |
| 22 |
verify the key purpose of the signer. It is expected for the caller |
| 23 |
to verify the intended purpose of the @code{signer} -e.g., via @code{gnutls_x509_crt_get_key_purpose_oid()} , |
| 24 |
or @code{gnutls_x509_crt_check_key_purpose()} . |
| 25 |
|
| 26 |
Note also, that since GnuTLS 3.5.6 this function introduces checks in the |
| 27 |
end certificate ( @code{signer} ), including time checks and key usage checks. |
| 28 |
|
| 29 |
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} (0) is returned, otherwise a |
| 30 |
negative error value. A verification error results to a |
| 31 |
@code{GNUTLS_E_PK_SIG_VERIFY_FAILED} and the lack of encapsulated data |
| 32 |
to verify to a @code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE} . |
| 33 |
|
| 34 |
@strong{Since:} 3.4.2 |
| 35 |
@end deftypefun |