1gnutls_pkcs7_sign(3) gnutls gnutls_pkcs7_sign(3)
2
3
4
6 gnutls_pkcs7_sign - API function
7
9 #include <gnutls/pkcs7.h>
10
11 int gnutls_pkcs7_sign(gnutls_pkcs7_t pkcs7, gnutls_x509_crt_t signer,
12 gnutls_privkey_t signer_key, const gnutls_datum_t * data,
13 gnutls_pkcs7_attrs_t signed_attrs, gnutls_pkcs7_attrs_t unsigned_attrs,
14 gnutls_digest_algorithm_t dig, unsigned flags);
15
17 gnutls_pkcs7_t pkcs7
18 should contain a gnutls_pkcs7_t type
19
20 gnutls_x509_crt_t signer
21 the certificate to sign the structure
22
23 gnutls_privkey_t signer_key
24 the key to sign the structure
25
26 const gnutls_datum_t * data
27 The data to be signed or NULL if the data are already
28 embedded
29
30 gnutls_pkcs7_attrs_t signed_attrs
31 Any additional attributes to be included in the signed ones
32 (or NULL)
33
34 gnutls_pkcs7_attrs_t unsigned_attrs
35 Any additional attributes to be included in the unsigned
36 ones (or NULL)
37
38 gnutls_digest_algorithm_t dig
39 The digest algorithm to use for signing
40
41 unsigned flags
42 Should be zero or one of GNUTLS_PKCS7 flags
43
45 This function will add a signature in the provided PKCS 7 structure for
46 the provided data. Multiple signatures can be made with different sign‐
47 ers.
48
49 The available flags are: GNUTLS_PKCS7_EMBED_DATA,
50 GNUTLS_PKCS7_INCLUDE_TIME, GNUTLS_PKCS7_INCLUDE_CERT, and
51 GNUTLS_PKCS7_WRITE_SPKI. They are explained in the
52 gnutls_pkcs7_sign_flags definition.
53
55 On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative
56 error value.
57
59 3.4.2
60
62 Report bugs to <bugs@gnutls.org>.
63 Home page: https://www.gnutls.org
64
65
67 Copyright © 2001-2019 Free Software Foundation, Inc., and others.
68 Copying and distribution of this file, with or without modification,
69 are permitted in any medium without royalty provided the copyright
70 notice and this notice are preserved.
71
73 The full documentation for gnutls is maintained as a Texinfo manual.
74 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
75 visit
76
77 https://www.gnutls.org/manual/
78
79gnutls 3.6.11 gnutls_pkcs7_sign(3)