Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / lib / signature.h
1 #ifndef H_SIGNATURE
2 #define H_SIGNATURE
3
4 /** \ingroup signature
5  * \file lib/signature.h
6  * Generate and verify signatures.
7  */
8 #include <rpm/rpmtypes.h>
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /** \ingroup signature
15  * Read (and verify header+payload size) signature header.
16  * If an old-style signature is found, we emulate a new style one.
17  * @param fd            file handle
18  * @retval sighp        address of (signature) header (or NULL)
19  * @retval msg          failure msg
20  * @return              rpmRC return code
21  */
22 rpmRC rpmReadSignature(FD_t fd, Header *sighp, char ** msg);
23
24 /** \ingroup signature
25  * Write signature header.
26  * @param fd            file handle
27  * @param h             (signature) header
28  * @return              0 on success, 1 on error
29  */
30 int rpmWriteSignature(FD_t fd, Header h);
31
32 /** \ingroup signature
33  * Generate signature and write to file
34  * @param SHA256        SHA256 digest
35  * @param SHA1          SHA1 digest
36  * @param MD5           MD5 digest
37  * @param size          size of header
38  * @param payloadSize   size of archive
39  * @param fd            output file
40  */
41 rpmRC rpmGenerateSignature(char *SHA256, char *SHA1, uint8_t *MD5,
42                         rpm_loff_t size, rpm_loff_t payloadSize, FD_t fd);
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif  /* H_SIGNATURE */