NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
pgplib.h
Go to the documentation of this file.
1
24#ifndef MUTT_NCRYPT_PGPLIB_H
25#define MUTT_NCRYPT_PGPLIB_H
26
27#include <stdbool.h>
28#include <time.h>
29#include "lib.h"
30
34struct PgpUid
35{
36 char *addr;
37 short trust;
38 int flags;
40 struct PgpUid *next;
41};
42
47{
48 char *keyid;
50 struct PgpUid *address;
52 short keylen;
53 time_t gen_time;
54 int numalg;
55 const char *algorithm;
58};
59
60const char *pgp_pkalgbytype(unsigned char type);
61
62struct PgpUid *pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent);
63
64bool pgp_canencrypt(unsigned char type);
65bool pgp_cansign(unsigned char type);
66
67void pgp_key_free(struct PgpKeyInfo **kpp);
68
69struct PgpKeyInfo *pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key);
70
72
73#endif /* MUTT_NCRYPT_PGPLIB_H */
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
Definition: lib.h:125
const char * pgp_pkalgbytype(unsigned char type)
Get the name of the algorithm from its ID.
Definition: pgplib.c:41
struct PgpKeyInfo * pgp_keyinfo_new(void)
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
Definition: pgplib.c:199
struct PgpKeyInfo * pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key)
Remove a PGP key from a list.
Definition: pgplib.c:167
bool pgp_cansign(unsigned char type)
Does this algorithm ID support signing?
Definition: pgplib.c:86
struct PgpUid * pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent)
Copy a list of PGP UIDs.
Definition: pgplib.c:126
bool pgp_canencrypt(unsigned char type)
Does this algorithm ID support encryption?
Definition: pgplib.c:67
Key value store.
Information about a PGP key.
Definition: pgplib.h:47
char * keyid
Definition: pgplib.h:48
KeyFlags flags
Definition: pgplib.h:51
struct PgpKeyInfo * next
Definition: pgplib.h:57
struct PgpUid * address
Definition: pgplib.h:50
char * fingerprint
Definition: pgplib.h:49
short keylen
Definition: pgplib.h:52
time_t gen_time
Definition: pgplib.h:53
const char * algorithm
Definition: pgplib.h:55
struct PgpKeyInfo * parent
Definition: pgplib.h:56
int numalg
Definition: pgplib.h:54
PGP User ID.
Definition: pgplib.h:35
short trust
Definition: pgplib.h:37
struct PgpKeyInfo * parent
Parent key.
Definition: pgplib.h:39
int flags
Definition: pgplib.h:38
char * addr
Definition: pgplib.h:36
struct PgpUid * next
Linked list.
Definition: pgplib.h:40