aboutsummaryrefslogtreecommitdiff
path: root/gpgme-vala/vapi/gpgme_public.vapi
blob: 86963025d472799c7ad1d7c5599ea864d9bd0be7 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
[CCode (lower_case_cprefix = "gpgme_", cheader_filename = "gpgme.h")]
namespace GPG {

[CCode (cname = "gpgme_check_version")]
public unowned string check_version(string? required_version = null);

[Compact]
[CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref", ref_function_void = true, unref_function = "gpgme_key_unref", free_function = "gpgme_key_release")]
public class Key {
    public bool revoked;
    public bool expired;
    public bool disabled;
    public bool invalid;
    public bool can_encrypt;
    public bool can_sign;
    public bool can_certify;
    public bool secret;
    public bool can_authenticate;
    public bool is_qualified;
    public Protocol protocol;
    public string issuer_serial;
    public string issuer_name;
    public string issuer_id;
    public Validity owner_trust;
    [CCode(array_null_terminated = true)]
    public SubKey[] subkeys;
    [CCode(array_null_terminated = true)]
    public UserID[] uids;
    public KeylistMode keylist_mode;
}

[CCode (cname = "struct _gpgme_user_id")]
public struct UserID {
    UserID* next;

    bool revoked;
    bool invalid;
    Validity validity;
    string uid;
    string name;
    string email;
    string comment;
    KeySig signatures;
}

[CCode (cname = "struct _gpgme_key_sig")]
public struct KeySig {
    KeySig* next;
    bool invoked;
    bool expired;
    bool invalid;
    bool exportable;
    PublicKeyAlgorithm algo;
    string keyid;
    long timestamp;
    long expires;
//    GPGError.Error status;
    string uid;
    string name;
    string email;
    string comment;
    uint sig_class;
    SigNotation notations;
}

[CCode (cname = "struct _gpgme_subkey")]
public struct SubKey {
    SubKey* next;
    bool revoked;
    bool expired;
    bool disabled;
    bool invalid;
    bool can_encrypt;
    bool can_sign;
    bool can_certify;
    bool secret;
    bool can_authenticate;
    bool is_qualified;
    bool is_cardkey;
    PublicKeyAlgorithm algo;
    uint length;
    string keyid;

    string fpr;
    long timestamp;
    long expires;
    string? cardnumber;
}

[CCode (cname = "struct _gpgme_sig_notation")]
public struct SigNotation {
    SigNotation* next;
    string? name;
    string value;
    int name_len;
    int value_len;
    SigNotationFlags flags;
    bool human_readable;
    bool critical;
}

[CCode (cname = "gpgme_sig_notation_flags_t", cprefix = "GPGME_SIG_NOTATION_")]
public enum SigNotationFlags {
    HUMAN_READABLE,
    CRITICAL
}

[CCode (cname = "gpgme_sig_mode_t", cprefix = "GPGME_SIG_MODE_")]
public enum SigMode {
    NORMAL,
    DETACH,
    CLEAR
}

[CCode (cname = "gpgme_encrypt_flags_t", cprefix = "GPGME_ENCRYPT_")]
public enum EncryptFlags {
    ALWAYS_TRUST,
    NO_ENCRYPT_TO
}

[CCode (cname = "gpgme_pubkey_algo_t", cprefix = "GPGME_PK_")]
public enum PublicKeyAlgorithm {
    RSA,
    RSA_E,
    RSA_S,
    ELG_E,
    DSA,
    ELG
}

[CCode (cname = "gpgme_protocol_t", cprefix = "GPGME_PROTOCOL_")]
public enum Protocol {
    OpenPGP,
    CMS,
    GPGCONF,
    ASSUAN,
    UNKNOWN
}

[CCode (cname = "gpgme_keylist_mode_t", cprefix = "GPGME_KEYLIST_MODE_")]
public enum KeylistMode {
    LOCAL,
    EXTERN,
    SIGS,
    SIG_NOTATIONS,
    EPHEMERAL,
    VALIDATE
}

[CCode (cname = "gpgme_validity_t", cprefix = "GPGME_VALIDITY_")]
public enum Validity {
    UNKNOWN,
    UNDEFINED,
    NEVER,
    MARGINAL,
    FULL,
    ULTIMATE
}

}