Go to the documentation of this file.
6 #include <rpm/rpmcli.h>
7 #include <rpm/rpmsign.h>
9 #include "lib/rpmsignfiles.h"
12 #if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(__KLIBC__)
30 N_(
"sign package(s)"), NULL },
32 N_(
"sign package(s) (identical to --addsign)"), NULL },
34 N_(
"delete package signatures"), NULL },
35 {
"signfiles",
'\0', POPT_ARG_NONE, &
signfiles, 0,
36 N_(
"sign package(s) files"), NULL},
38 N_(
"use file signing key <key>"),
40 {
"fskpass",
'\0', POPT_ARG_NONE, &
fskpass, 0,
41 N_(
"prompt for file signing key password"), NULL},
47 N_(
"Signature options:"), NULL },
49 N_(
"Common options for all rpm modes and executables:"), NULL },
57 static int doSign(poptContext optCon)
59 int rc = EXIT_FAILURE;
60 char * passPhrase = NULL;
61 char * name =
rpmExpand(
"%{?_gpg_name}", NULL);
65 fprintf(stderr,
_(
"You must set \"%%_gpg_name\" in your macro file\n"));
74 const char *key =
rpmExpand(
"%{?_file_signing_key}", NULL);
76 fprintf(stderr,
_(
"You must set \"$$_file_signing_key\" in your macro file or on the command line with --fskpath\n"));
82 argerror(
_(
"--fskpass may only be specified when signing files"));
88 addMacro(NULL,
"_file_signing_key_password", NULL,
100 while ((arg = poptGetArg(optCon)) != NULL) {
110 int main(
int argc,
char *argv[])
112 int ec = EXIT_FAILURE;
121 if (poptPeekArg(optCon) == NULL) {
126 argerror(
_(
"--fskpath may only be specified when signing files"));
136 while ((arg = poptGetArg(optCon)) != NULL) {
141 argerror(
_(
"only one major mode may be specified"));
int rpmPkgSign(const char *path, const struct rpmSignArgs *args)
poptContext rpmcliFini(poptContext optCon)
static struct poptOption signOptsTable[]
char * rpmExpand(const char *arg,...) RPM_GNUC_NULL_TERMINATED
static char * fileSigningKeyPassword
void printUsage(poptContext con, FILE *fp, int flags)
int main(int argc, char *argv[])
void argerror(const char *desc)
static struct poptOption optionsTable[]
static char * fileSigningKey
int rpmPkgDelSign(const char *path)
static int doSign(poptContext optCon)
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
static int rstreq(const char *s1, const char *s2)
Test for string equality.
struct poptOption rpmcliAllPoptTable[]
void addMacro(rpmMacroContext mc, const char *n, const char *o, const char *b, int level)