1 // pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
4 // This file will be processed by the MIDL tool to
5 // produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
13 uuid(161538F9-53C8-4D9C-8BA4-0FB43AEC7106),
16 pointer_default(unique)
18 interface ITextMessage : IUnknown {
19 typedef enum _pEp_text_format {
20 pEp_text_format_plain = 0,
22 pEp_text_format_other = 0xff
25 typedef enum _pEp_msg_direction {
30 typedef enum _pEp_MIME_format {
31 pEp_MIME_none = 0, // message is not MIME encoded
32 pEp_MIME_fields_omitted, // message content but no fields
33 pEp_MIME // message is fully MIME encoded
36 typedef enum _pEp_enc_format {
37 pEp_enc_none = 0, // message is not encrypted
38 pEp_enc_pieces, // inline PGP + PGP extensions
39 pEp_enc_S_MIME, // RFC5751
40 pEp_enc_PGP_MIME, // RFC3156
41 pEp_enc_pEp // pEp encryption format
44 [propget] HRESULT dir([out, retval] pEp_msg_direction *pVal);
45 [propput] HRESULT dir([in] pEp_msg_direction newVal);
47 [propget] HRESULT id([out, retval] BSTR *pVal);
48 [propput] HRESULT id([in] BSTR newVal);
50 [propget] HRESULT shortmsg([out, retval] BSTR *pVal);
51 [propput] HRESULT shortmsg([in] BSTR newVal);
53 [propget] HRESULT longmsg([out, retval] BSTR *pVal);
54 [propput] HRESULT longmsg([in] BSTR newVal);
56 [propget] HRESULT longmsg_formatted([out, retval] BSTR *pVal);
57 [propput] HRESULT longmsg_formatted([in] BSTR newVal);
59 HRESULT add_attachment([in] SAFEARRAY(BYTE) data, [in, optional] BSTR mime_type, [in, optional] BSTR filename);
60 HRESULT has_attachments([out, retval] boolean *result);
61 HRESULT next_attachment([out] SAFEARRAY(BYTE) * data, [out] BSTR * mime_type, [out] BSTR * filename, [out, retval] boolean *result);
63 [propget] HRESULT sent([out, retval] hyper * result);
64 [propput] HRESULT sent([in] hyper val);
66 [propget] HRESULT recv([out, retval] hyper * result);
67 [propput] HRESULT recv([in] hyper val);
69 [propget] HRESULT from([out, retval] struct pEp_identity_s *pVal);
70 [propput] HRESULT from([in] struct pEp_identity_s *newVal);
72 [propget] HRESULT to([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
73 [propput] HRESULT to([in] SAFEARRAY(struct pEp_identity_s) newVal);
75 [propget] HRESULT recv_by([out, retval] struct pEp_identity_s *pVal);
76 [propput] HRESULT recv_by([in] struct pEp_identity_s *newVal);
78 [propget] HRESULT cc([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
79 [propput] HRESULT cc([in] SAFEARRAY(struct pEp_identity_s) newVal);
81 [propget] HRESULT bcc([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
82 [propput] HRESULT bcc([in] SAFEARRAY(struct pEp_identity_s) newVal);
84 [propget] HRESULT reply_to([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
85 [propput] HRESULT reply_to([in] SAFEARRAY(struct pEp_identity_s) newVal);
87 [propget] HRESULT references([out, retval] SAFEARRAY(BSTR) *pVal);
88 [propput] HRESULT references([in] SAFEARRAY(BSTR) newVal);
90 [propget] HRESULT keywords([out, retval] SAFEARRAY(BSTR) *pVal);
91 [propput] HRESULT keywords([in] SAFEARRAY(BSTR) newVal);
93 [propget] HRESULT comments([out, retval] BSTR *pVal);
94 [propput] HRESULT comments([in] BSTR newVal);
99 uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
102 pointer_default(unique)
104 interface IpEpEngine : IUnknown {
105 typedef enum _pEp_STATUS {
108 pEp_KEY_NOT_FOUND = 0x0201,
109 pEp_KEY_HAS_AMBIG_NAME = 0x0202,
110 pEp_GET_KEY_FAILED = 0x0203,
112 pEp_UNENCRYPTED = 0x0400,
113 pEp_VERIFIED = 0x0401,
114 pEp_DECRYPTED = 0x0402,
115 pEp_DECRYPTED_AND_VERIFIED = 0x0403,
116 pEp_DECRYPT_WRONG_FORMAT = 0x0404,
117 pEp_DECRYPT_NO_KEY = 0x0405,
118 pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
119 pEp_VERIFY_NO_KEY = 0x0407,
120 pEp_VERIFIED_AND_TRUSTED = 0x0408,
122 pEp_ILLEGAL_VALUE = -4,
123 pEp_BUFFER_TOO_SMALL = -3,
124 pEp_OUT_OF_MEMORY = -2,
125 pEp_UNKNOWN_ERROR = -1
128 HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
129 HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
130 HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
131 HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
132 HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
133 HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
134 HRESULT trustword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
135 HRESULT trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
137 typedef enum _pEp_comm_type {
140 // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
142 pEp_ct_no_encryption = 0x01, // generic
143 pEp_ct_no_encrypted_channel = 0x02,
144 pEp_ct_key_not_found = 0x03,
145 pEp_ct_key_expired = 0x04,
146 pEp_ct_key_revoked = 0x05,
147 pEp_ct_key_b0rken = 0x06,
148 pEp_ct_my_key_not_included = 0x09,
150 pEp_ct_security_by_obscurity = 0x0a,
151 pEp_ct_b0rken_crypto = 0x0b,
152 pEp_ct_key_too_short = 0x0e,
154 pEp_ct_compromized = 0x0f, // known compromized connection
156 // range 0x10 to 0x3f: unconfirmed encryption
158 pEp_ct_unconfirmed_encryption = 0x10, // generic
159 pEp_ct_OpenPGP_1024_RSA_unconfirmed = 0x11, // RSA 1024 is weak
160 pEp_ct_OpenPGP_unconfirmed = 0x3f, // key at least 2048 bit RSA
163 // range 0x40 to 0x7f: unconfirmed encryption and anonymization
165 pEp_ct_unconfirmed_enc_anon = 0x40, // generic
166 pEp_ct_pEp_unconfirmed = 0x7f,
168 pEp_ct_confirmed = 0x80, // this bit decides if trust is confirmed
170 // range 0x81 to 0x8f: reserved
171 // range 0x90 to 0xbf: confirmed encryption
173 pEp_ct_confirmed_encryption = 0x90, // generic
174 pEp_ct_OpenPGP_1024_RSA = 0x91, // RSA 1024 is weak
175 pEp_ct_OpenPGP = 0xbf, // key at least 2048 bit RSA or 1024 bit DSA
177 // range 0xc0 to 0xff: confirmed encryption and anonymization
179 pEp_ct_confirmed_enc_anon = 0xc0, // generic
183 [uuid(CAAC4CFB-4EE6-4C27-81F7-E5B4E0A46816)] struct pEp_identity_s {
188 pEp_comm_type comm_type;
192 HRESULT get_identity([in] BSTR address, [out, retval] struct pEp_identity_s * ident);
193 HRESULT set_identity([in] struct pEp_identity_s * ident);
194 HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
195 HRESULT delete_keypair([in] BSTR fpr);
196 HRESULT import_key([in] BSTR key_data);
197 HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
198 HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
199 HRESULT recv_key([in] BSTR pattern);
200 HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
201 HRESULT send_key([in] BSTR pattern);
203 HRESULT examine_identity([in] struct pEp_identity_s * ident);
204 HRESULT examine_myself([in] struct pEp_identity_s * myself);
205 HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
206 HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
207 HRESULT key_compromized([in] BSTR fpr);
211 typedef enum _pEp_color {
212 pEp_rating_undefined = 0,
213 pEp_rating_unencrypted,
214 pEp_rating_cannot_decrypt,
215 pEp_rating_unreliable,
217 pEp_rating_yellow = pEp_rating_reliable,
219 pEp_rating_green = pEp_rating_trusted,
220 pEp_rating_trusted_and_anonymized,
221 pEp_rating_fully_anonymous,
223 pEp_rating_under_attack = -1,
224 pEp_rating_red = pEp_rating_under_attack,
225 pEp_rating_b0rken = -2
228 HRESULT encrypt_message([in] ITextMessage *src, [out] ITextMessage ** dst, [in, optional] SAFEARRAY(BSTR) extra);
229 HRESULT decrypt_message([in] ITextMessage *src, [out] ITextMessage ** dst, [out] SAFEARRAY(BSTR) *keylist);
230 HRESULT message_color([in] ITextMessage *msg, [out, retval] pEp_color * pVal);
231 HRESULT identity_color([in] struct pEp_identity_s * ident, [out, retval] pEp_color * pVal);
235 uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
238 library pEpCOMServerAdapterLib
240 importlib("stdole2.tlb");
242 uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
244 dispinterface _IpEpEngineEvents
250 uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
253 [default] interface IpEpEngine;
254 [default, source] dispinterface _IpEpEngineEvents;
257 uuid(844B5363-4EF4-4A39-A030-16452783A6F7)
259 dispinterface _ITextMessageEvents
265 uuid(B6CC444F-FE14-4DFE-8315-81E4EA16C1CC)
269 [default] interface ITextMessage;
270 [default, source] dispinterface _ITextMessageEvents;