vb@0
|
1 |
// pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
|
vb@0
|
2 |
//
|
vb@0
|
3 |
|
vb@0
|
4 |
// This file will be processed by the MIDL tool to
|
vb@0
|
5 |
// produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
|
vb@0
|
6 |
|
vb@0
|
7 |
import "oaidl.idl";
|
vb@0
|
8 |
import "ocidl.idl";
|
vb@0
|
9 |
|
vb@0
|
10 |
[
|
vb@0
|
11 |
object,
|
vb@0
|
12 |
uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
|
vb@0
|
13 |
oleautomation,
|
vb@0
|
14 |
nonextensible,
|
vb@0
|
15 |
pointer_default(unique)
|
vb@0
|
16 |
]
|
vb@0
|
17 |
interface IpEpEngine : IUnknown {
|
vb@51
|
18 |
HRESULT verbose_logging([in] BOOL enable);
|
vb@51
|
19 |
|
vb@41
|
20 |
typedef enum _pEp_STATUS {
|
vb@0
|
21 |
pEp_STATUS_OK = 0,
|
vb@0
|
22 |
|
vb@0
|
23 |
pEp_KEY_NOT_FOUND = 0x0201,
|
vb@0
|
24 |
pEp_KEY_HAS_AMBIG_NAME = 0x0202,
|
vb@0
|
25 |
pEp_GET_KEY_FAILED = 0x0203,
|
vb@0
|
26 |
|
vb@0
|
27 |
pEp_UNENCRYPTED = 0x0400,
|
vb@0
|
28 |
pEp_VERIFIED = 0x0401,
|
vb@0
|
29 |
pEp_DECRYPTED = 0x0402,
|
vb@0
|
30 |
pEp_DECRYPTED_AND_VERIFIED = 0x0403,
|
vb@0
|
31 |
pEp_DECRYPT_WRONG_FORMAT = 0x0404,
|
vb@0
|
32 |
pEp_DECRYPT_NO_KEY = 0x0405,
|
vb@0
|
33 |
pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
|
vb@0
|
34 |
pEp_VERIFY_NO_KEY = 0x0407,
|
vb@0
|
35 |
pEp_VERIFIED_AND_TRUSTED = 0x0408,
|
vb@0
|
36 |
|
vb@0
|
37 |
pEp_ILLEGAL_VALUE = -4,
|
vb@0
|
38 |
pEp_BUFFER_TOO_SMALL = -3,
|
vb@0
|
39 |
pEp_OUT_OF_MEMORY = -2,
|
vb@0
|
40 |
pEp_UNKNOWN_ERROR = -1
|
vb@0
|
41 |
} pEp_STATUS;
|
vb@0
|
42 |
|
vb@4
|
43 |
HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
|
vb@4
|
44 |
HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
|
vb@4
|
45 |
HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
|
vb@4
|
46 |
HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
|
vb@4
|
47 |
HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
|
vb@4
|
48 |
HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
|
vb@17
|
49 |
HRESULT trustword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
|
vb@17
|
50 |
HRESULT trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
|
vb@57
|
51 |
HRESULT get_crashdump_log([in] LONG maxlines, [out, retval] BSTR * log);
|
vb@0
|
52 |
|
vb@0
|
53 |
typedef enum _pEp_comm_type {
|
vb@0
|
54 |
pEp_ct_unknown = 0,
|
vb@0
|
55 |
|
vb@0
|
56 |
// range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
|
vb@0
|
57 |
|
vb@0
|
58 |
pEp_ct_no_encryption = 0x01, // generic
|
vb@0
|
59 |
pEp_ct_no_encrypted_channel = 0x02,
|
vb@0
|
60 |
pEp_ct_key_not_found = 0x03,
|
vb@0
|
61 |
pEp_ct_key_expired = 0x04,
|
vb@0
|
62 |
pEp_ct_key_revoked = 0x05,
|
vb@0
|
63 |
pEp_ct_key_b0rken = 0x06,
|
vb@0
|
64 |
pEp_ct_my_key_not_included = 0x09,
|
vb@0
|
65 |
|
vb@0
|
66 |
pEp_ct_security_by_obscurity = 0x0a,
|
vb@0
|
67 |
pEp_ct_b0rken_crypto = 0x0b,
|
vb@0
|
68 |
pEp_ct_key_too_short = 0x0e,
|
vb@0
|
69 |
|
vb@0
|
70 |
pEp_ct_compromized = 0x0f, // known compromized connection
|
vb@0
|
71 |
|
vb@0
|
72 |
// range 0x10 to 0x3f: unconfirmed encryption
|
vb@0
|
73 |
|
vb@0
|
74 |
pEp_ct_unconfirmed_encryption = 0x10, // generic
|
vb@0
|
75 |
pEp_ct_OpenPGP_1024_RSA_unconfirmed = 0x11, // RSA 1024 is weak
|
vb@0
|
76 |
pEp_ct_OpenPGP_unconfirmed = 0x3f, // key at least 2048 bit RSA
|
vb@0
|
77 |
// or 1024 bit DSA
|
vb@0
|
78 |
|
vb@0
|
79 |
// range 0x40 to 0x7f: unconfirmed encryption and anonymization
|
vb@0
|
80 |
|
vb@0
|
81 |
pEp_ct_unconfirmed_enc_anon = 0x40, // generic
|
vb@0
|
82 |
pEp_ct_pEp_unconfirmed = 0x7f,
|
vb@0
|
83 |
|
vb@0
|
84 |
pEp_ct_confirmed = 0x80, // this bit decides if trust is confirmed
|
vb@0
|
85 |
|
vb@0
|
86 |
// range 0x81 to 0x8f: reserved
|
vb@0
|
87 |
// range 0x90 to 0xbf: confirmed encryption
|
vb@0
|
88 |
|
vb@0
|
89 |
pEp_ct_confirmed_encryption = 0x90, // generic
|
vb@0
|
90 |
pEp_ct_OpenPGP_1024_RSA = 0x91, // RSA 1024 is weak
|
vb@0
|
91 |
pEp_ct_OpenPGP = 0xbf, // key at least 2048 bit RSA or 1024 bit DSA
|
vb@0
|
92 |
|
vb@0
|
93 |
// range 0xc0 to 0xff: confirmed encryption and anonymization
|
vb@0
|
94 |
|
vb@0
|
95 |
pEp_ct_confirmed_enc_anon = 0xc0, // generic
|
vb@0
|
96 |
pEp_ct_pEp = 0xff
|
vb@0
|
97 |
} pEp_comm_type;
|
vb@0
|
98 |
|
vb@22
|
99 |
[uuid(0CB90E62-8A6A-4CA0-99D7-481704051FF0)] struct pEp_identity_s {
|
vb@0
|
100 |
BSTR address;
|
vb@0
|
101 |
BSTR fpr;
|
vb@0
|
102 |
BSTR user_id;
|
vb@0
|
103 |
BSTR username;
|
vb@0
|
104 |
pEp_comm_type comm_type;
|
vb@0
|
105 |
BSTR lang;
|
vb@0
|
106 |
};
|
vb@0
|
107 |
|
vb@4
|
108 |
HRESULT get_identity([in] BSTR address, [out, retval] struct pEp_identity_s * ident);
|
vb@4
|
109 |
HRESULT set_identity([in] struct pEp_identity_s * ident);
|
vb@4
|
110 |
HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
|
vb@4
|
111 |
HRESULT delete_keypair([in] BSTR fpr);
|
vb@4
|
112 |
HRESULT import_key([in] BSTR key_data);
|
vb@4
|
113 |
HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
|
vb@4
|
114 |
HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
|
vb@4
|
115 |
HRESULT recv_key([in] BSTR pattern);
|
vb@4
|
116 |
HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
|
vb@4
|
117 |
HRESULT send_key([in] BSTR pattern);
|
vb@0
|
118 |
|
vb@24
|
119 |
HRESULT start_keyserver_lookup();
|
vb@24
|
120 |
HRESULT stop_keyserver_lookup();
|
vb@24
|
121 |
|
vb@4
|
122 |
HRESULT examine_identity([in] struct pEp_identity_s * ident);
|
vb@4
|
123 |
HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
|
vb@4
|
124 |
HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
|
vb@49
|
125 |
HRESULT key_compromized([in] struct pEp_identity_s *ident);
|
Edouard@55
|
126 |
HRESULT key_reset_trust([in] struct pEp_identity_s *ident);
|
vb@50
|
127 |
HRESULT trust_personal_key([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
|
vb@4
|
128 |
|
vb@15
|
129 |
// Message API
|
vb@12
|
130 |
|
vb@15
|
131 |
typedef enum _pEp_color {
|
vb@18
|
132 |
pEp_rating_undefined = 0,
|
vb@20
|
133 |
pEp_rating_cannot_decrypt,
|
vb@20
|
134 |
pEp_rating_have_no_key,
|
vb@18
|
135 |
pEp_rating_unencrypted,
|
vb@18
|
136 |
pEp_rating_unreliable,
|
vb@18
|
137 |
pEp_rating_reliable,
|
vb@18
|
138 |
pEp_rating_yellow = pEp_rating_reliable,
|
vb@18
|
139 |
pEp_rating_trusted,
|
vb@18
|
140 |
pEp_rating_green = pEp_rating_trusted,
|
vb@18
|
141 |
pEp_rating_trusted_and_anonymized,
|
vb@18
|
142 |
pEp_rating_fully_anonymous,
|
vb@12
|
143 |
|
vb@56
|
144 |
pEp_rating_mistrust = -1,
|
vb@56
|
145 |
pEp_rating_red = pEp_rating_mistrust,
|
vb@56
|
146 |
pEp_rating_b0rken = -2,
|
vb@56
|
147 |
pEp_rating_under_attack = -3
|
vb@15
|
148 |
} pEp_color;
|
vb@13
|
149 |
|
vb@33
|
150 |
typedef enum _pEp_text_format {
|
vb@33
|
151 |
pEp_text_format_plain = 0,
|
vb@33
|
152 |
pEp_text_format_html,
|
vb@33
|
153 |
pEp_text_format_other = 0xff
|
vb@33
|
154 |
} pEp_text_format;
|
vb@33
|
155 |
|
vb@41
|
156 |
typedef enum _pEp_msg_direction {
|
vb@33
|
157 |
pEp_dir_incoming = 0,
|
vb@33
|
158 |
pEp_dir_outgoing
|
vb@33
|
159 |
} pEp_msg_direction;
|
vb@33
|
160 |
|
vb@41
|
161 |
typedef enum _pEp_MIME_format {
|
vb@33
|
162 |
pEp_MIME_none = 0, // message is not MIME encoded
|
vb@33
|
163 |
pEp_MIME_fields_omitted, // message content but no fields
|
vb@33
|
164 |
pEp_MIME // message is fully MIME encoded
|
vb@33
|
165 |
} pEp_MIME_format;
|
vb@33
|
166 |
|
vb@41
|
167 |
typedef enum _pEp_enc_format {
|
vb@33
|
168 |
pEp_enc_none = 0, // message is not encrypted
|
vb@33
|
169 |
pEp_enc_pieces, // inline PGP + PGP extensions
|
vb@33
|
170 |
pEp_enc_S_MIME, // RFC5751
|
vb@33
|
171 |
pEp_enc_PGP_MIME, // RFC3156
|
vb@33
|
172 |
pEp_enc_pEp // pEp encryption format
|
vb@33
|
173 |
} pEp_enc_format;
|
vb@33
|
174 |
|
vb@33
|
175 |
[uuid(3A8A4F13-3402-4C4C-94AB-598D87869380)] struct opt_field {
|
vb@33
|
176 |
BSTR name;
|
vb@33
|
177 |
BSTR value;
|
vb@33
|
178 |
};
|
vb@33
|
179 |
|
vb@33
|
180 |
[uuid(61DA7AD4-192E-4616-8678-B19AEFB45B45)] struct blob {
|
vb@33
|
181 |
SAFEARRAY(BYTE) value;
|
vb@33
|
182 |
BSTR mime_type;
|
vb@33
|
183 |
BSTR filename;
|
vb@33
|
184 |
};
|
vb@33
|
185 |
|
vb@33
|
186 |
[uuid(D763A8F3-BA23-4229-A037-1BB7BDC3E0C8)] struct text_message {
|
vb@33
|
187 |
pEp_msg_direction dir;
|
vb@33
|
188 |
BSTR id;
|
vb@33
|
189 |
BSTR shortmsg;
|
vb@33
|
190 |
BSTR longmsg;
|
vb@33
|
191 |
BSTR longmsg_formatted;
|
vb@33
|
192 |
SAFEARRAY(struct blob) attachments;
|
vb@33
|
193 |
hyper sent;
|
vb@33
|
194 |
hyper recv;
|
vb@33
|
195 |
struct pEp_identity_s from;
|
vb@33
|
196 |
SAFEARRAY(struct pEp_identity_s) to;
|
vb@33
|
197 |
struct pEp_identity_s recv_by;
|
vb@33
|
198 |
SAFEARRAY(struct pEp_identity_s) cc;
|
vb@33
|
199 |
SAFEARRAY(struct pEp_identity_s) bcc;
|
vb@33
|
200 |
SAFEARRAY(struct pEp_identity_s) reply_to;
|
vb@33
|
201 |
SAFEARRAY(BSTR) references;
|
vb@33
|
202 |
SAFEARRAY(BSTR) keywords;
|
vb@33
|
203 |
BSTR comments;
|
vb@33
|
204 |
SAFEARRAY(struct opt_field) opt_fields;
|
vb@33
|
205 |
};
|
vb@33
|
206 |
|
vb@37
|
207 |
HRESULT encrypt_message([in] struct text_message *src, [out] struct text_message * dst, [in] SAFEARRAY(BSTR) extra);
|
vb@37
|
208 |
HRESULT decrypt_message([in] struct text_message *src, [out] struct text_message * dst, [out] SAFEARRAY(BSTR) *keylist, [out, retval] pEp_color *rating);
|
vb@33
|
209 |
HRESULT outgoing_message_color([in] struct text_message *msg, [out, retval] pEp_color * pVal);
|
vb@18
|
210 |
HRESULT identity_color([in] struct pEp_identity_s * ident, [out, retval] pEp_color * pVal);
|
vb@8
|
211 |
};
|
vb@4
|
212 |
|
vb@8
|
213 |
[
|
vb@0
|
214 |
uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
|
vb@0
|
215 |
version(1.0),
|
vb@0
|
216 |
]
|
vb@0
|
217 |
library pEpCOMServerAdapterLib
|
vb@0
|
218 |
{
|
vb@0
|
219 |
importlib("stdole2.tlb");
|
vb@0
|
220 |
[
|
vb@0
|
221 |
uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
|
vb@0
|
222 |
]
|
vb@0
|
223 |
dispinterface _IpEpEngineEvents
|
vb@0
|
224 |
{
|
vb@0
|
225 |
properties:
|
vb@0
|
226 |
methods:
|
vb@0
|
227 |
};
|
vb@0
|
228 |
[
|
vb@0
|
229 |
uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
|
vb@0
|
230 |
]
|
vb@0
|
231 |
coclass pEpEngine {
|
vb@0
|
232 |
[default] interface IpEpEngine;
|
vb@0
|
233 |
[default, source] dispinterface _IpEpEngineEvents;
|
vb@0
|
234 |
};
|
vb@0
|
235 |
};
|