NeoMutt  2024-10-02-37-gfa9146
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};
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
66{
81};
82
83const char *pgp_pkalgbytype(unsigned char type);
84
85struct PgpUid *pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent);
86
87bool pgp_canencrypt(unsigned char type);
88bool pgp_cansign(unsigned char type);
89
90void pgp_key_free(struct PgpKeyInfo **kpp);
91
92struct PgpKeyInfo *pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key);
93
95
96#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: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:66
@ ED_PGK_KEY_CAPABILITIES
PgpKeyInfo.flags, pgp_key_abilities()
Definition: pgplib.h:69
@ ED_PGK_KEY_FINGERPRINT
PgpKeyInfo.fingerprint.
Definition: pgplib.h:70
@ ED_PGK_PKEY_LENGTH
pgp_principal_key(), PgpKeyInfo.keylen
Definition: pgplib.h:79
@ ED_PGK_PKEY_ALGORITHM
pgp_principal_key(), PgpKeyInfo.algorithm
Definition: pgplib.h:74
@ ED_PGK_DATE
PgpKeyInfo.gen_time.
Definition: pgplib.h:67
@ ED_PGK_PKEY_FINGERPRINT
pgp_principal_key(), PgpKeyInfo.fingerprint
Definition: pgplib.h:76
@ ED_PGK_KEY_ID
PgpKeyInfo, pgp_this_keyid()
Definition: pgplib.h:72
@ ED_PGK_PROTOCOL
PgpKeyInfo.
Definition: pgplib.h:80
@ ED_PGK_PKEY_CAPABILITIES
pgp_principal_key(), PgpKeyInfo.flags, pgp_key_abilities()
Definition: pgplib.h:75
@ ED_PGK_KEY_FLAGS
PgpKeyInfo.kflags, pgp_flags()
Definition: pgplib.h:71
@ ED_PGK_PKEY_ID
pgp_principal_key(), PgpKeyInfo, pgp_this_keyid()
Definition: pgplib.h:78
@ ED_PGK_KEY_ALGORITHM
PgpKeyInfo.algorithm.
Definition: pgplib.h:68
@ ED_PGK_KEY_LENGTH
PgpKeyInfo.keylen.
Definition: pgplib.h:73
@ ED_PGK_PKEY_FLAGS
pgp_principal_key(), PgpKeyInfo.kflags, pgp_flags()
Definition: pgplib.h:77
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: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