summaryrefslogtreecommitdiffstats
path: root/RPM4/src/RPM4.xs
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4/src/RPM4.xs')
-rw-r--r--RPM4/src/RPM4.xs21
1 files changed, 21 insertions, 0 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index a2002ea..e2ee589 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -84,6 +84,10 @@
#include <rpm/rpmlog.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmtag.h>
+#include <rpm/rpmcli.h>
+#ifdef RPM4_9_0
+#include <rpm/rpmsign.h>
+#endif
#ifdef HAVE_RPMCONSTANT
#include <rpmconstant/rpmconstant.h>
@@ -489,6 +493,23 @@ int _headername_vs_dep(Header h, rpmds dep, int nopromote) {
/* return 1 if match */
}
+/* Hight level function */
+int rpmsign(char *passphrase, const char *rpm) {
+#ifdef RPM4_9_0
+ return rpmPkgSign(rpm, NULL, passphrase);
+#else
+ QVA_t qva = &rpmQVKArgs;
+ ARGV_t file = NULL;
+
+ argvAdd(&file, rpm);
+
+ qva->qva_mode = RPMSIGN_ADD_SIGNATURE;
+ qva->passPhrase = passphrase;
+
+ return rpmcliSign(NULL, qva, file);
+#endif
+}
+
MODULE = RPM4 PACKAGE = RPM4
BOOT: