NeoMutt  2020-08-21-74-g346364
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 
34 struct PgpUid
35 {
36  char *addr;
37  short trust;
38  int flags;
39  struct PgpKeyInfo *parent;
40  struct PgpUid *next;
41 };
42 
46 struct PgpKeyInfo
47 {
48  char *keyid;
49  char *fingerprint;
50  struct PgpUid *address;
52  short keylen;
53  time_t gen_time;
54  int numalg;
55  const char *algorithm;
56  struct PgpKeyInfo *parent;
57  struct PgpKeyInfo *next;
58 };
59 
60 const char *pgp_pkalgbytype(unsigned char type);
61 
62 struct PgpUid *pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent);
63 
64 bool pgp_canencrypt(unsigned char type);
65 bool pgp_cansign(unsigned char type);
66 
67 void pgp_key_free(struct PgpKeyInfo **kpp);
68 
69 struct PgpKeyInfo *pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key);
70 
71 struct PgpKeyInfo *pgp_keyinfo_new(void);
72 
73 #endif /* MUTT_NCRYPT_PGPLIB_H */
struct PgpKeyInfo * next
Definition: pgplib.h:57
struct PgpUid * next
Definition: pgplib.h:40
int numalg
Definition: pgplib.h:54
const char * pgp_pkalgbytype(unsigned char type)
Get the name of the algorithm from its ID.
Definition: pgplib.c:41
PGP User ID.
Definition: pgplib.h:34
KeyFlags flags
Definition: pgplib.h:51
struct PgpKeyInfo * pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key)
Remove a PGP key from a list.
Definition: pgplib.c:167
bool pgp_canencrypt(unsigned char type)
Does this algorithm ID support encryption?
Definition: pgplib.c:67
char * keyid
Definition: pgplib.h:48
char * addr
Definition: pgplib.h:36
Information about a PGP key.
Definition: pgplib.h:46
short trust
Definition: pgplib.h:37
short keylen
Definition: pgplib.h:52
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
Definition: lib.h:132
bool pgp_cansign(unsigned char type)
Does this algorithm ID support signing?
Definition: pgplib.c:86
struct PgpUid * address
Definition: pgplib.h:50
struct PgpKeyInfo * pgp_keyinfo_new(void)
API for encryption/signing of emails.
struct PgpKeyInfo * parent
Definition: pgplib.h:39
struct PgpUid * pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent)
Copy a list of PGP UIDs.
Definition: pgplib.c:126
const char * algorithm
Definition: pgplib.h:55
struct PgpKeyInfo * parent
Definition: pgplib.h:56
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
Definition: pgplib.c:199
char * fingerprint
Definition: pgplib.h:49
int flags
Definition: pgplib.h:38
time_t gen_time
Definition: pgplib.h:53