NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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};
42ARRAY_HEAD(PgpUidArray, struct PgpUid *);
43
48{
49 char *keyid;
51 struct PgpUid *address;
53 short keylen;
54 time_t gen_time;
55 int numalg;
56 const char *algorithm;
59};
60
67{
82};
83
84const char *pgp_pkalgbytype(unsigned char type);
85
86struct PgpUid *pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent);
87
88bool pgp_canencrypt(unsigned char type);
89bool pgp_cansign(unsigned char type);
90
91void pgp_key_free(struct PgpKeyInfo **kpp);
92
93struct PgpKeyInfo *pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key);
94
96
97#endif /* MUTT_NCRYPT_PGPLIB_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
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:42
struct PgpKeyInfo * pgp_keyinfo_new(void)
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
Definition: pgplib.c:201
ExpandoDataPgpKey
Expando UIDs for PGP Keys.
Definition: pgplib.h:67
@ ED_PGK_KEY_CAPABILITIES
PgpKeyInfo.flags, pgp_key_abilities()
Definition: pgplib.h:70
@ ED_PGK_KEY_FINGERPRINT
PgpKeyInfo.fingerprint.
Definition: pgplib.h:71
@ ED_PGK_PKEY_LENGTH
pgp_principal_key(), PgpKeyInfo.keylen
Definition: pgplib.h:80
@ ED_PGK_PKEY_ALGORITHM
pgp_principal_key(), PgpKeyInfo.algorithm
Definition: pgplib.h:75
@ ED_PGK_DATE
PgpKeyInfo.gen_time.
Definition: pgplib.h:68
@ ED_PGK_PKEY_FINGERPRINT
pgp_principal_key(), PgpKeyInfo.fingerprint
Definition: pgplib.h:77
@ ED_PGK_KEY_ID
PgpKeyInfo, pgp_this_keyid()
Definition: pgplib.h:73
@ ED_PGK_PROTOCOL
PgpKeyInfo.
Definition: pgplib.h:81
@ ED_PGK_PKEY_CAPABILITIES
pgp_principal_key(), PgpKeyInfo.flags, pgp_key_abilities()
Definition: pgplib.h:76
@ ED_PGK_KEY_FLAGS
PgpKeyInfo.kflags, pgp_flags()
Definition: pgplib.h:72
@ ED_PGK_PKEY_ID
pgp_principal_key(), PgpKeyInfo, pgp_this_keyid()
Definition: pgplib.h:79
@ ED_PGK_KEY_ALGORITHM
PgpKeyInfo.algorithm.
Definition: pgplib.h:69
@ ED_PGK_KEY_LENGTH
PgpKeyInfo.keylen.
Definition: pgplib.h:74
@ ED_PGK_PKEY_FLAGS
pgp_principal_key(), PgpKeyInfo.kflags, pgp_flags()
Definition: pgplib.h:78
struct PgpKeyInfo * pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key)
Remove a PGP key from a list.
Definition: pgplib.c:169
bool pgp_cansign(unsigned char type)
Does this algorithm ID support signing?
Definition: pgplib.c:87
struct PgpUid * pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent)
Copy a list of PGP UIDs.
Definition: pgplib.c:127
bool pgp_canencrypt(unsigned char type)
Does this algorithm ID support encryption?
Definition: pgplib.c:68
Key value store.
Information about a PGP key.
Definition: pgplib.h:48
char * keyid
Definition: pgplib.h:49
KeyFlags flags
Definition: pgplib.h:52
struct PgpKeyInfo * next
Definition: pgplib.h:58
struct PgpUid * address
Definition: pgplib.h:51
char * fingerprint
Definition: pgplib.h:50
short keylen
Definition: pgplib.h:53
time_t gen_time
Definition: pgplib.h:54
const char * algorithm
Definition: pgplib.h:56
struct PgpKeyInfo * parent
Definition: pgplib.h:57
int numalg
Definition: pgplib.h:55
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