Blame doc/pkcs7-api.texi

Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_add_attr
Packit Service 4684c1
@anchor{gnutls_pkcs7_add_attr}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_add_attr} (gnutls_pkcs7_attrs_t * @var{list}, const char * @var{oid}, gnutls_datum_t * @var{data}, unsigned @var{flags})
Packit Service 4684c1
@var{list}: A list of existing attributes or pointer to @code{NULL}  for the first one
Packit Service 4684c1
Packit Service 4684c1
@var{oid}: the OID of the attribute to be set
Packit Service 4684c1
Packit Service 4684c1
@var{data}: the raw (DER-encoded) data of the attribute to be set
Packit Service 4684c1
Packit Service 4684c1
@var{flags}: zero or @code{GNUTLS_PKCS7_ATTR_ENCODE_OCTET_STRING} 
Packit Service 4684c1
Packit Service 4684c1
This function will set a PKCS @code{7}  attribute in the provided list.
Packit Service 4684c1
If this function fails, the previous list would be deallocated.
Packit Service 4684c1
Packit Service 4684c1
Note that any attributes set with this function must either be
Packit Service 4684c1
DER or BER encoded, unless a special flag is present.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, the new list head, otherwise @code{NULL} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_attrs_deinit
Packit Service 4684c1
@anchor{gnutls_pkcs7_attrs_deinit}
Packit Service 4684c1
@deftypefun {void} {gnutls_pkcs7_attrs_deinit} (gnutls_pkcs7_attrs_t @var{list})
Packit Service 4684c1
@var{list}: A list of existing attributes
Packit Service 4684c1
Packit Service 4684c1
This function will clear a PKCS @code{7}  attribute list.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_deinit
Packit Service 4684c1
@anchor{gnutls_pkcs7_deinit}
Packit Service 4684c1
@deftypefun {void} {gnutls_pkcs7_deinit} (gnutls_pkcs7_t @var{pkcs7})
Packit Service 4684c1
@var{pkcs7}: the type to be deinitialized
Packit Service 4684c1
Packit Service 4684c1
This function will deinitialize a PKCS7 type.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_delete_crl
Packit Service 4684c1
@anchor{gnutls_pkcs7_delete_crl}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_delete_crl} (gnutls_pkcs7_t @var{pkcs7}, int @var{indx})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{indx}: the index of the crl to delete
Packit Service 4684c1
Packit Service 4684c1
This function will delete a crl from a PKCS7 or RFC2630 crl set.
Packit Service 4684c1
Index starts from 0. Returns 0 on success.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_delete_crt
Packit Service 4684c1
@anchor{gnutls_pkcs7_delete_crt}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_delete_crt} (gnutls_pkcs7_t @var{pkcs7}, int @var{indx})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{indx}: the index of the certificate to delete
Packit Service 4684c1
Packit Service 4684c1
This function will delete a certificate from a PKCS7 or RFC2630
Packit Service 4684c1
certificate set.  Index starts from 0. Returns 0 on success.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_export
Packit Service 4684c1
@anchor{gnutls_pkcs7_export}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_export} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_crt_fmt_t @var{format}, void * @var{output_data}, size_t * @var{output_data_size})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{format}: the format of output params. One of PEM or DER.
Packit Service 4684c1
Packit Service 4684c1
@var{output_data}: will contain a structure PEM or DER encoded
Packit Service 4684c1
Packit Service 4684c1
@var{output_data_size}: holds the size of output_data (and will be
Packit Service 4684c1
replaced by the actual size of parameters)
Packit Service 4684c1
Packit Service 4684c1
This function will export the pkcs7 structure to DER or PEM format.
Packit Service 4684c1
Packit Service 4684c1
If the buffer provided is not long enough to hold the output, then
Packit Service 4684c1
* @code{output_data_size} is updated and @code{GNUTLS_E_SHORT_MEMORY_BUFFER} 
Packit Service 4684c1
will be returned.
Packit Service 4684c1
Packit Service 4684c1
If the structure is PEM encoded, it will have a header
Packit Service 4684c1
of "BEGIN PKCS7".
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_export2
Packit Service 4684c1
@anchor{gnutls_pkcs7_export2}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_export2} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_crt_fmt_t @var{format}, gnutls_datum_t * @var{out})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{format}: the format of output params. One of PEM or DER.
Packit Service 4684c1
Packit Service 4684c1
@var{out}: will contain a structure PEM or DER encoded
Packit Service 4684c1
Packit Service 4684c1
This function will export the pkcs7 structure to DER or PEM format.
Packit Service 4684c1
Packit Service 4684c1
The output buffer is allocated using @code{gnutls_malloc()} .
Packit Service 4684c1
Packit Service 4684c1
If the structure is PEM encoded, it will have a header
Packit Service 4684c1
of "BEGIN PKCS7".
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.1.3
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_attr
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_attr}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_attr} (gnutls_pkcs7_attrs_t @var{list}, unsigned @var{idx}, char ** @var{oid}, gnutls_datum_t * @var{data}, unsigned @var{flags})
Packit Service 4684c1
@var{list}: A list of existing attributes or @code{NULL}  for the first one
Packit Service 4684c1
Packit Service 4684c1
@var{idx}: the index of the attribute to get
Packit Service 4684c1
Packit Service 4684c1
@var{oid}: the OID of the attribute (read-only)
Packit Service 4684c1
Packit Service 4684c1
@var{data}: the raw data of the attribute
Packit Service 4684c1
Packit Service 4684c1
@var{flags}: zero or @code{GNUTLS_PKCS7_ATTR_ENCODE_OCTET_STRING} 
Packit Service 4684c1
Packit Service 4684c1
This function will get a PKCS @code{7}  attribute from the provided list.
Packit Service 4684c1
The OID is a constant string, but data will be allocated and must be
Packit Service 4684c1
deinitialized by the caller.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value. @code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  is returned
Packit Service 4684c1
if there are no data in the current index.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_crl_count
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_crl_count}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_crl_count} (gnutls_pkcs7_t @var{pkcs7})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
This function will return the number of certificates in the PKCS7
Packit Service 4684c1
or RFC2630 crl set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_crl_raw
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_crl_raw}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_crl_raw} (gnutls_pkcs7_t @var{pkcs7}, unsigned @var{indx}, void * @var{crl}, size_t * @var{crl_size})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{indx}: contains the index of the crl to extract
Packit Service 4684c1
Packit Service 4684c1
@var{crl}: the contents of the crl will be copied there (may be null)
Packit Service 4684c1
Packit Service 4684c1
@var{crl_size}: should hold the size of the crl
Packit Service 4684c1
Packit Service 4684c1
This function will return a crl of the PKCS7 or RFC2630 crl set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.  If the provided buffer is not long enough,
Packit Service 4684c1
then  @code{crl_size} is updated and @code{GNUTLS_E_SHORT_MEMORY_BUFFER}  is
Packit Service 4684c1
returned.  After the last crl has been read
Packit Service 4684c1
@code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  will be returned.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_crl_raw2
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_crl_raw2}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_crl_raw2} (gnutls_pkcs7_t @var{pkcs7}, unsigned @var{indx}, gnutls_datum_t * @var{crl})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{indx}: contains the index of the crl to extract
Packit Service 4684c1
Packit Service 4684c1
@var{crl}: will contain the contents of the CRL in an allocated buffer
Packit Service 4684c1
Packit Service 4684c1
This function will return a DER encoded CRL of the PKCS7 or RFC2630 crl set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.  After the last crl has been read
Packit Service 4684c1
@code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  will be returned.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_crt_count
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_crt_count}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_crt_count} (gnutls_pkcs7_t @var{pkcs7})
Packit Service 4684c1
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t}  type
Packit Service 4684c1
Packit Service 4684c1
This function will return the number of certificates in the PKCS7
Packit Service 4684c1
or RFC2630 certificate set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, a positive number is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_crt_raw
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_crt_raw}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_crt_raw} (gnutls_pkcs7_t @var{pkcs7}, unsigned @var{indx}, void * @var{certificate}, size_t * @var{certificate_size})
Packit Service 4684c1
@var{pkcs7}: should contain a gnutls_pkcs7_t type
Packit Service 4684c1
Packit Service 4684c1
@var{indx}: contains the index of the certificate to extract
Packit Service 4684c1
Packit Service 4684c1
@var{certificate}: the contents of the certificate will be copied
Packit Service 4684c1
there (may be null)
Packit Service 4684c1
Packit Service 4684c1
@var{certificate_size}: should hold the size of the certificate
Packit Service 4684c1
Packit Service 4684c1
This function will return a certificate of the PKCS7 or RFC2630
Packit Service 4684c1
certificate set.
Packit Service 4684c1
Packit Service 4684c1
After the last certificate has been read
Packit Service 4684c1
@code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  will be returned.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.  If the provided buffer is not long enough,
Packit Service 4684c1
then  @code{certificate_size} is updated and
Packit Service 4684c1
@code{GNUTLS_E_SHORT_MEMORY_BUFFER}  is returned.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_crt_raw2
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_crt_raw2}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_crt_raw2} (gnutls_pkcs7_t @var{pkcs7}, unsigned @var{indx}, gnutls_datum_t * @var{cert})
Packit Service 4684c1
@var{pkcs7}: should contain a gnutls_pkcs7_t type
Packit Service 4684c1
Packit Service 4684c1
@var{indx}: contains the index of the certificate to extract
Packit Service 4684c1
Packit Service 4684c1
@var{cert}: will hold the contents of the certificate; must be deallocated with @code{gnutls_free()} 
Packit Service 4684c1
Packit Service 4684c1
This function will return a certificate of the PKCS7 or RFC2630
Packit Service 4684c1
certificate set.
Packit Service 4684c1
Packit Service 4684c1
After the last certificate has been read
Packit Service 4684c1
@code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  will be returned.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.  If the provided buffer is not long enough,
Packit Service 4684c1
then  @code{certificate_size} is updated and
Packit Service 4684c1
@code{GNUTLS_E_SHORT_MEMORY_BUFFER}  is returned.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_embedded_data
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_embedded_data}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_embedded_data} (gnutls_pkcs7_t @var{pkcs7}, unsigned @var{flags}, gnutls_datum_t * @var{data})
Packit Service 4684c1
@var{pkcs7}: should contain a gnutls_pkcs7_t type
Packit Service 4684c1
Packit Service 4684c1
@var{flags}: must be zero or @code{GNUTLS_PKCS7_EDATA_GET_RAW} 
Packit Service 4684c1
Packit Service 4684c1
@var{data}: will hold the embedded data in the provided structure
Packit Service 4684c1
Packit Service 4684c1
This function will return the data embedded in the signature of
Packit Service 4684c1
the PKCS7 structure. If no data are available then
Packit Service 4684c1
@code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  will be returned.
Packit Service 4684c1
Packit Service 4684c1
The returned data must be de-allocated using @code{gnutls_free()} .
Packit Service 4684c1
Packit Service 4684c1
Note, that this function returns the exact same data that are
Packit Service 4684c1
authenticated. If the @code{GNUTLS_PKCS7_EDATA_GET_RAW}  flag is provided,
Packit Service 4684c1
the returned data will be including the wrapping tag/value as
Packit Service 4684c1
they are encoded in the structure.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.8
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_embedded_data_oid
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_embedded_data_oid}
Packit Service 4684c1
@deftypefun {const char *} {gnutls_pkcs7_get_embedded_data_oid} (gnutls_pkcs7_t @var{pkcs7})
Packit Service 4684c1
@var{pkcs7}: should contain a gnutls_pkcs7_t type
Packit Service 4684c1
Packit Service 4684c1
This function will return the OID of the data embedded in the signature of
Packit Service 4684c1
the PKCS7 structure. If no data are available then @code{NULL}  will be
Packit Service 4684c1
returned. The returned value will be valid during the lifetime
Packit Service 4684c1
of the  @code{pkcs7} structure.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, a pointer to an OID string, @code{NULL}  on error.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.5.5
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_signature_count
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_signature_count}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_signature_count} (gnutls_pkcs7_t @var{pkcs7})
Packit Service 4684c1
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t}  type
Packit Service 4684c1
Packit Service 4684c1
This function will return the number of signatures in the PKCS7
Packit Service 4684c1
structure.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, a positive number is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.3
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_get_signature_info
Packit Service 4684c1
@anchor{gnutls_pkcs7_get_signature_info}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_get_signature_info} (gnutls_pkcs7_t @var{pkcs7}, unsigned @var{idx}, gnutls_pkcs7_signature_info_st * @var{info})
Packit Service 4684c1
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t}  type
Packit Service 4684c1
Packit Service 4684c1
@var{idx}: the index of the signature info to check
Packit Service 4684c1
Packit Service 4684c1
@var{info}: will contain the output signature
Packit Service 4684c1
Packit Service 4684c1
This function will return information about the signature identified
Packit Service 4684c1
by idx in the provided PKCS @code{7}  structure. The information should be
Packit Service 4684c1
deinitialized using @code{gnutls_pkcs7_signature_info_deinit()} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_import
Packit Service 4684c1
@anchor{gnutls_pkcs7_import}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_import} (gnutls_pkcs7_t @var{pkcs7}, const gnutls_datum_t * @var{data}, gnutls_x509_crt_fmt_t @var{format})
Packit Service 4684c1
@var{pkcs7}: The data to store the parsed PKCS7.
Packit Service 4684c1
Packit Service 4684c1
@var{data}: The DER or PEM encoded PKCS7.
Packit Service 4684c1
Packit Service 4684c1
@var{format}: One of DER or PEM
Packit Service 4684c1
Packit Service 4684c1
This function will convert the given DER or PEM encoded PKCS7 to
Packit Service 4684c1
the native @code{gnutls_pkcs7_t}  format.  The output will be stored in
Packit Service 4684c1
 @code{pkcs7} .
Packit Service 4684c1
Packit Service 4684c1
If the PKCS7 is PEM encoded it should have a header of "PKCS7".
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_init
Packit Service 4684c1
@anchor{gnutls_pkcs7_init}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_init} (gnutls_pkcs7_t * @var{pkcs7})
Packit Service 4684c1
@var{pkcs7}: A pointer to the type to be initialized
Packit Service 4684c1
Packit Service 4684c1
This function will initialize a PKCS7 structure. PKCS7 structures
Packit Service 4684c1
usually contain lists of X.509 Certificates and X.509 Certificate
Packit Service 4684c1
revocation lists.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_print
Packit Service 4684c1
@anchor{gnutls_pkcs7_print}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_print} (gnutls_pkcs7_t @var{pkcs7}, gnutls_certificate_print_formats_t @var{format}, gnutls_datum_t * @var{out})
Packit Service 4684c1
@var{pkcs7}: The PKCS7 struct to be printed
Packit Service 4684c1
Packit Service 4684c1
@var{format}: Indicate the format to use
Packit Service 4684c1
Packit Service 4684c1
@var{out}: Newly allocated datum with null terminated string.
Packit Service 4684c1
Packit Service 4684c1
This function will pretty print a signed PKCS @code{7}  structure, suitable for
Packit Service 4684c1
display to a human.
Packit Service 4684c1
Packit Service 4684c1
Currently the supported formats are @code{GNUTLS_CRT_PRINT_FULL}  and
Packit Service 4684c1
@code{GNUTLS_CRT_PRINT_COMPACT} .
Packit Service 4684c1
Packit Service 4684c1
The output  @code{out} needs to be deallocated using @code{gnutls_free()} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_print_signature_info
Packit Service 4684c1
@anchor{gnutls_pkcs7_print_signature_info}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_print_signature_info} (gnutls_pkcs7_signature_info_st * @var{info}, gnutls_certificate_print_formats_t @var{format}, gnutls_datum_t * @var{out})
Packit Service 4684c1
@var{info}: The PKCS7 signature info struct to be printed
Packit Service 4684c1
Packit Service 4684c1
@var{format}: Indicate the format to use
Packit Service 4684c1
Packit Service 4684c1
@var{out}: Newly allocated datum with null terminated string.
Packit Service 4684c1
Packit Service 4684c1
This function will pretty print a PKCS @code{7}  signature info structure, suitable
Packit Service 4684c1
for display to a human.
Packit Service 4684c1
Packit Service 4684c1
Currently the supported formats are @code{GNUTLS_CRT_PRINT_FULL}  and
Packit Service 4684c1
@code{GNUTLS_CRT_PRINT_COMPACT} .
Packit Service 4684c1
Packit Service 4684c1
The output  @code{out} needs to be deallocated using @code{gnutls_free()} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.6.14
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_set_crl
Packit Service 4684c1
@anchor{gnutls_pkcs7_set_crl}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_set_crl} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_crl_t @var{crl})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{crl}: the DER encoded crl to be added
Packit Service 4684c1
Packit Service 4684c1
This function will add a parsed CRL to the PKCS7 or RFC2630 crl
Packit Service 4684c1
set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_set_crl_raw
Packit Service 4684c1
@anchor{gnutls_pkcs7_set_crl_raw}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_set_crl_raw} (gnutls_pkcs7_t @var{pkcs7}, const gnutls_datum_t * @var{crl})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{crl}: the DER encoded crl to be added
Packit Service 4684c1
Packit Service 4684c1
This function will add a crl to the PKCS7 or RFC2630 crl set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_set_crt
Packit Service 4684c1
@anchor{gnutls_pkcs7_set_crt}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_set_crt} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_crt_t @var{crt})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{crt}: the certificate to be copied.
Packit Service 4684c1
Packit Service 4684c1
This function will add a parsed certificate to the PKCS7 or
Packit Service 4684c1
RFC2630 certificate set.  This is a wrapper function over
Packit Service 4684c1
@code{gnutls_pkcs7_set_crt_raw()}  .
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_set_crt_raw
Packit Service 4684c1
@anchor{gnutls_pkcs7_set_crt_raw}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_set_crt_raw} (gnutls_pkcs7_t @var{pkcs7}, const gnutls_datum_t * @var{crt})
Packit Service 4684c1
@var{pkcs7}: The pkcs7 type
Packit Service 4684c1
Packit Service 4684c1
@var{crt}: the DER encoded certificate to be added
Packit Service 4684c1
Packit Service 4684c1
This function will add a certificate to the PKCS7 or RFC2630
Packit Service 4684c1
certificate set.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_sign
Packit Service 4684c1
@anchor{gnutls_pkcs7_sign}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_sign} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_crt_t @var{signer}, gnutls_privkey_t @var{signer_key}, const gnutls_datum_t * @var{data}, gnutls_pkcs7_attrs_t @var{signed_attrs}, gnutls_pkcs7_attrs_t @var{unsigned_attrs}, gnutls_digest_algorithm_t @var{dig}, unsigned @var{flags})
Packit Service 4684c1
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t}  type
Packit Service 4684c1
Packit Service 4684c1
@var{signer}: the certificate to sign the structure
Packit Service 4684c1
Packit Service 4684c1
@var{signer_key}: the key to sign the structure
Packit Service 4684c1
Packit Service 4684c1
@var{data}: The data to be signed or @code{NULL}  if the data are already embedded
Packit Service 4684c1
Packit Service 4684c1
@var{signed_attrs}: Any additional attributes to be included in the signed ones (or @code{NULL} )
Packit Service 4684c1
Packit Service 4684c1
@var{unsigned_attrs}: Any additional attributes to be included in the unsigned ones (or @code{NULL} )
Packit Service 4684c1
Packit Service 4684c1
@var{dig}: The digest algorithm to use for signing
Packit Service 4684c1
Packit Service 4684c1
@var{flags}: Should be zero or one of @code{GNUTLS_PKCS7}  flags
Packit Service 4684c1
Packit Service 4684c1
This function will add a signature in the provided PKCS @code{7}  structure
Packit Service 4684c1
for the provided data. Multiple signatures can be made with different
Packit Service 4684c1
signers.
Packit Service 4684c1
Packit Service 4684c1
The available flags are:
Packit Service 4684c1
@code{GNUTLS_PKCS7_EMBED_DATA} , @code{GNUTLS_PKCS7_INCLUDE_TIME} , @code{GNUTLS_PKCS7_INCLUDE_CERT} ,
Packit Service 4684c1
and @code{GNUTLS_PKCS7_WRITE_SPKI} . They are explained in the @code{gnutls_pkcs7_sign_flags} 
Packit Service 4684c1
definition.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value.
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_signature_info_deinit
Packit Service 4684c1
@anchor{gnutls_pkcs7_signature_info_deinit}
Packit Service 4684c1
@deftypefun {void} {gnutls_pkcs7_signature_info_deinit} (gnutls_pkcs7_signature_info_st * @var{info})
Packit Service 4684c1
@var{info}: should point to a @code{gnutls_pkcs7_signature_info_st}  structure
Packit Service 4684c1
Packit Service 4684c1
This function will deinitialize any allocated value in the
Packit Service 4684c1
provided @code{gnutls_pkcs7_signature_info_st} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_verify
Packit Service 4684c1
@anchor{gnutls_pkcs7_verify}
Packit Service 4684c1
@deftypefun {int} {gnutls_pkcs7_verify} (gnutls_pkcs7_t @var{pkcs7}, gnutls_x509_trust_list_t @var{tl}, gnutls_typed_vdata_st * @var{vdata}, unsigned int @var{vdata_size}, unsigned @var{idx}, const gnutls_datum_t * @var{data}, unsigned @var{flags})
Packit Service 4684c1
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t}  type
Packit Service 4684c1
Packit Service 4684c1
@var{tl}: A list of trusted certificates
Packit Service 4684c1
Packit Service 4684c1
@var{vdata}: an array of typed data
Packit Service 4684c1
Packit Service 4684c1
@var{vdata_size}: the number of data elements
Packit Service 4684c1
Packit Service 4684c1
@var{idx}: the index of the signature info to check
Packit Service 4684c1
Packit Service 4684c1
@var{data}: The data to be verified or @code{NULL} 
Packit Service 4684c1
Packit Service 4684c1
@var{flags}: Zero or an OR list of @code{gnutls_certificate_verify_flags} 
Packit Service 4684c1
Packit Service 4684c1
This function will verify the provided data against the signature
Packit Service 4684c1
present in the SignedData of the PKCS @code{7}  structure. If the data
Packit Service 4684c1
provided are NULL then the data in the encapsulatedContent field
Packit Service 4684c1
will be used instead.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value. A verification error results to a
Packit Service 4684c1
@code{GNUTLS_E_PK_SIG_VERIFY_FAILED}  and the lack of encapsulated data
Packit Service 4684c1
to verify to a @code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1
Packit Service 4684c1
@subheading gnutls_pkcs7_verify_direct
Packit Service 4684c1
@anchor{gnutls_pkcs7_verify_direct}
Packit Service 4684c1
@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})
Packit Service 4684c1
@var{pkcs7}: should contain a @code{gnutls_pkcs7_t}  type
Packit Service 4684c1
Packit Service 4684c1
@var{signer}: the certificate believed to have signed the structure
Packit Service 4684c1
Packit Service 4684c1
@var{idx}: the index of the signature info to check
Packit Service 4684c1
Packit Service 4684c1
@var{data}: The data to be verified or @code{NULL} 
Packit Service 4684c1
Packit Service 4684c1
@var{flags}: Zero or an OR list of @code{gnutls_certificate_verify_flags} 
Packit Service 4684c1
Packit Service 4684c1
This function will verify the provided data against the signature
Packit Service 4684c1
present in the SignedData of the PKCS @code{7}  structure. If the data
Packit Service 4684c1
provided are NULL then the data in the encapsulatedContent field
Packit Service 4684c1
will be used instead.
Packit Service 4684c1
Packit Service 4684c1
Note that, unlike @code{gnutls_pkcs7_verify()}  this function does not
Packit Service 4684c1
verify the key purpose of the signer. It is expected for the caller
Packit Service 4684c1
to verify the intended purpose of the @code{signer}  -e.g., via @code{gnutls_x509_crt_get_key_purpose_oid()} ,
Packit Service 4684c1
or @code{gnutls_x509_crt_check_key_purpose()} .
Packit Service 4684c1
Packit Service 4684c1
Note also, that since GnuTLS 3.5.6 this function introduces checks in the
Packit Service 4684c1
end certificate ( @code{signer} ), including time checks and key usage checks.
Packit Service 4684c1
Packit Service 4684c1
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise a
Packit Service 4684c1
negative error value. A verification error results to a
Packit Service 4684c1
@code{GNUTLS_E_PK_SIG_VERIFY_FAILED}  and the lack of encapsulated data
Packit Service 4684c1
to verify to a @code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Since:} 3.4.2
Packit Service 4684c1
@end deftypefun
Packit Service 4684c1