NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
pgplib.h
Go to the documentation of this file.
1
23
24
#ifndef MUTT_NCRYPT_PGPLIB_H
25
#define MUTT_NCRYPT_PGPLIB_H
26
27
#include <stdbool.h>
28
#include <time.h>
29
#include "
mutt/lib.h
"
30
#include "
lib.h
"
31
35
struct
PgpUid
36
{
37
char
*
addr
;
38
short
trust
;
39
int
flags
;
40
struct
PgpKeyInfo
*
parent
;
41
struct
PgpUid
*
next
;
42
};
43
ARRAY_HEAD
(PgpUidArray,
struct
PgpUid
*);
44
48
struct
PgpKeyInfo
49
{
50
char
*
keyid
;
51
char
*
fingerprint
;
52
struct
PgpUid
*
address
;
53
KeyFlags
flags
;
54
short
keylen
;
55
time_t
gen_time
;
56
int
numalg
;
57
const
char
*
algorithm
;
58
struct
PgpKeyInfo
*
parent
;
59
struct
PgpKeyInfo
*
next
;
60
};
61
67
enum
ExpandoDataPgpKey
68
{
69
ED_PGK_DATE
= 1,
70
ED_PGK_KEY_ALGORITHM
,
71
ED_PGK_KEY_CAPABILITIES
,
72
ED_PGK_KEY_FINGERPRINT
,
73
ED_PGK_KEY_FLAGS
,
74
ED_PGK_KEY_ID
,
75
ED_PGK_KEY_LENGTH
,
76
ED_PGK_PKEY_ALGORITHM
,
77
ED_PGK_PKEY_CAPABILITIES
,
78
ED_PGK_PKEY_FINGERPRINT
,
79
ED_PGK_PKEY_FLAGS
,
80
ED_PGK_PKEY_ID
,
81
ED_PGK_PKEY_LENGTH
,
82
ED_PGK_PROTOCOL
,
83
};
84
85
const
char
*
pgp_pkalgbytype
(
unsigned
char
type);
86
87
struct
PgpUid
*
pgp_copy_uids
(
struct
PgpUid
*up,
struct
PgpKeyInfo
*
parent
);
88
89
bool
pgp_canencrypt
(
unsigned
char
type);
90
bool
pgp_cansign
(
unsigned
char
type);
91
92
void
pgp_key_free
(
struct
PgpKeyInfo
**kpp);
93
94
struct
PgpKeyInfo
*
pgp_remove_key
(
struct
PgpKeyInfo
**klist,
struct
PgpKeyInfo
*key);
95
96
struct
PgpKeyInfo
*
pgp_keyinfo_new
(
void
);
97
98
#endif
/* MUTT_NCRYPT_PGPLIB_H */
ARRAY_HEAD
#define ARRAY_HEAD(name, T)
Define a named struct for arrays of elements of a certain type.
Definition
array.h:47
lib.h
Convenience wrapper for the library headers.
lib.h
API for encryption/signing of emails.
KeyFlags
uint16_t KeyFlags
Definition
lib.h:159
pgp_pkalgbytype
const char * pgp_pkalgbytype(unsigned char type)
Get the name of the algorithm from its ID.
Definition
pgplib.c:42
pgp_keyinfo_new
struct PgpKeyInfo * pgp_keyinfo_new(void)
pgp_key_free
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
Definition
pgplib.c:204
ExpandoDataPgpKey
ExpandoDataPgpKey
Expando UIDs for PGP Keys.
Definition
pgplib.h:68
ED_PGK_KEY_CAPABILITIES
@ ED_PGK_KEY_CAPABILITIES
PgpKeyInfo.flags, pgp_key_abilities().
Definition
pgplib.h:71
ED_PGK_KEY_FINGERPRINT
@ ED_PGK_KEY_FINGERPRINT
PgpKeyInfo.fingerprint.
Definition
pgplib.h:72
ED_PGK_PKEY_LENGTH
@ ED_PGK_PKEY_LENGTH
pgp_principal_key(), PgpKeyInfo.keylen
Definition
pgplib.h:81
ED_PGK_PKEY_ALGORITHM
@ ED_PGK_PKEY_ALGORITHM
pgp_principal_key(), PgpKeyInfo.algorithm
Definition
pgplib.h:76
ED_PGK_DATE
@ ED_PGK_DATE
PgpKeyInfo.gen_time.
Definition
pgplib.h:69
ED_PGK_PKEY_FINGERPRINT
@ ED_PGK_PKEY_FINGERPRINT
pgp_principal_key(), PgpKeyInfo.fingerprint
Definition
pgplib.h:78
ED_PGK_KEY_ID
@ ED_PGK_KEY_ID
PgpKeyInfo, pgp_this_keyid().
Definition
pgplib.h:74
ED_PGK_PROTOCOL
@ ED_PGK_PROTOCOL
PgpKeyInfo.
Definition
pgplib.h:82
ED_PGK_PKEY_CAPABILITIES
@ ED_PGK_PKEY_CAPABILITIES
pgp_principal_key(), PgpKeyInfo.flags, pgp_key_abilities()
Definition
pgplib.h:77
ED_PGK_KEY_FLAGS
@ ED_PGK_KEY_FLAGS
PgpKeyInfo.kflags, pgp_flags().
Definition
pgplib.h:73
ED_PGK_PKEY_ID
@ ED_PGK_PKEY_ID
pgp_principal_key(), PgpKeyInfo, pgp_this_keyid()
Definition
pgplib.h:80
ED_PGK_KEY_ALGORITHM
@ ED_PGK_KEY_ALGORITHM
PgpKeyInfo.algorithm.
Definition
pgplib.h:70
ED_PGK_KEY_LENGTH
@ ED_PGK_KEY_LENGTH
PgpKeyInfo.keylen.
Definition
pgplib.h:75
ED_PGK_PKEY_FLAGS
@ ED_PGK_PKEY_FLAGS
pgp_principal_key(), PgpKeyInfo.kflags, pgp_flags()
Definition
pgplib.h:79
pgp_remove_key
struct PgpKeyInfo * pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo *key)
Remove a PGP key from a list.
Definition
pgplib.c:170
pgp_cansign
bool pgp_cansign(unsigned char type)
Does this algorithm ID support signing?
Definition
pgplib.c:87
pgp_copy_uids
struct PgpUid * pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent)
Copy a list of PGP UIDs.
Definition
pgplib.c:128
pgp_canencrypt
bool pgp_canencrypt(unsigned char type)
Does this algorithm ID support encryption?
Definition
pgplib.c:68
PgpKeyInfo
Information about a PGP key.
Definition
pgplib.h:49
PgpKeyInfo::keyid
char * keyid
Key ID.
Definition
pgplib.h:50
PgpKeyInfo::flags
KeyFlags flags
Key flags.
Definition
pgplib.h:53
PgpKeyInfo::next
struct PgpKeyInfo * next
Linked list.
Definition
pgplib.h:59
PgpKeyInfo::address
struct PgpUid * address
User IDs.
Definition
pgplib.h:52
PgpKeyInfo::fingerprint
char * fingerprint
Key fingerprint.
Definition
pgplib.h:51
PgpKeyInfo::keylen
short keylen
Key length.
Definition
pgplib.h:54
PgpKeyInfo::gen_time
time_t gen_time
Key generation time.
Definition
pgplib.h:55
PgpKeyInfo::algorithm
const char * algorithm
Algorithm name.
Definition
pgplib.h:57
PgpKeyInfo::parent
struct PgpKeyInfo * parent
Parent key.
Definition
pgplib.h:58
PgpKeyInfo::numalg
int numalg
Algorithm number.
Definition
pgplib.h:56
PgpUid
PGP User ID.
Definition
pgplib.h:36
PgpUid::trust
short trust
Trust level.
Definition
pgplib.h:38
PgpUid::parent
struct PgpKeyInfo * parent
Parent key.
Definition
pgplib.h:40
PgpUid::flags
int flags
Flags for this UID.
Definition
pgplib.h:39
PgpUid::addr
char * addr
Email address.
Definition
pgplib.h:37
PgpUid::next
struct PgpUid * next
Linked list.
Definition
pgplib.h:41