summaryrefslogtreecommitdiffstats
path: root/RPM4/src/RPM4sign.c
blob: 114dcd9610eb7a51ead473f83f2d6928010d0da0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* $Id$ */

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#undef Fflush
#undef Mkdir
#undef Stat

#include <rpm/rpmcli.h>
#ifdef RPM4_9_0
#include <rpm/rpmsign.h>
#endif

#include "RPM4.h"

/* 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
}