summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/include/sequoia/openpgp/serialize.h
blob: 77cbfdce56b7f61d0fe378502eab1587ce249783 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef SEQUOIA_OPENPGP_SERIALIZE_H
#define SEQUOIA_OPENPGP_SERIALIZE_H

/*/
/// Creates a new recipient with an explicit recipient keyid.
///
/// Consumes `keyid`, references `key`.
/*/
pgp_recipient_t pgp_recipient_new (pgp_keyid_t keyid, pgp_key_t key);

/*/
/// Frees this object.
/*/
void pgp_recipient_free (pgp_recipient_t);

/*/
/// Returns a human readable description of this object suitable for
/// debugging.
/*/
char *pgp_recipient_debug (const pgp_recipient_t);

/*/
/// Gets the KeyID.
/*/
pgp_keyid_t pgp_recipient_keyid (const pgp_recipient_t);

/*/
/// Sets the KeyID.
/*/
void pgp_recipient_set_keyid (pgp_recipient_t *, pgp_keyid_t);

/*/
/// Collects recipients from a `pgp_cert_key_iter_t`.
///
/// Consumes the iterator.  The returned buffer must be freed using
/// libc's allocator.
/*/
pgp_recipient_t *pgp_recipients_from_key_iter (pgp_cert_key_iter_t, size_t *);

/*/
/// Collects recipients from a `pgp_cert_valid_key_iter_t`.
///
/// Consumes the iterator.  The returned buffer must be freed using
/// libc's allocator.
/*/
pgp_recipient_t *pgp_recipients_from_valid_key_iter (pgp_cert_valid_key_iter_t, size_t *);

#endif