pEpCOMServerAdapter.idl
author Markus Schaber <markus@pep-security.net>
Tue, 04 Oct 2016 23:07:42 +0200
branchkeysync
changeset 178 9f30e2a5f72c
parent 177 4d197f1c3abb
child 180 51f843f18dd2
permissions -rw-r--r--
COM-30 COM-24: Refactorings
Drop unused enum.
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
markus@84
    10
[
markus@84
    11
	object,
markus@172
    12
	uuid(4DA92647-A858-448E-B01F-BE4DCB8C86A1),
markus@84
    13
	oleautomation,
markus@84
    14
	nonextensible,
markus@84
    15
	pointer_default(unique)
markus@84
    16
]
markus@84
    17
interface IpEpEngineCallbacks : IUnknown {
markus@172
    18
markus@172
    19
    typedef [v1_enum] enum SyncHandshakeResult {
markus@172
    20
	    SyncHandshakeCancel = -1,
markus@172
    21
	    SyncHandshakeAccepted = 0,
markus@172
    22
	    SyncHandshakeRejected = 1
markus@172
    23
    } SyncHandshakeResult;
markus@172
    24
markus@172
    25
	[id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
markus@172
    26
	[id(2)] HRESULT ShowHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [out, retval] SyncHandshakeResult * result);
markus@84
    27
};
markus@84
    28
markus@84
    29
vb@0
    30
[
vb@0
    31
    object,
markus@172
    32
    uuid(045E49AF-0975-4876-A53B-8CA5AB28C0F8),
vb@0
    33
    oleautomation,
vb@0
    34
    nonextensible,
vb@0
    35
    pointer_default(unique)
vb@0
    36
]
vb@0
    37
interface IpEpEngine : IUnknown {
markus@177
    38
vb@60
    39
    // runtime config of the adapter
vb@60
    40
markus@172
    41
    HRESULT VerboseLogging([in] VARIANT_BOOL enable);
vb@51
    42
vb@60
    43
    // runtime config of the engine
vb@60
    44
markus@172
    45
    HRESULT PassiveMode([in] VARIANT_BOOL enable);
markus@172
    46
    HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
vb@60
    47
vb@60
    48
    // basic API
vb@60
    49
markus@177
    50
    HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
markus@177
    51
    HRESULT TrustWords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
markus@172
    52
    HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
markus@177
    53
    HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
markus@177
    54
    HRESULT GetLanguageList([out, retval] BSTR * languages);
vb@0
    55
markus@172
    56
    typedef [v1_enum] enum pEpComType {
markus@172
    57
        pEpCtUnknown = 0,
vb@0
    58
vb@0
    59
        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
vb@0
    60
markus@172
    61
        pEpCtNoEncryption = 0x01,                // generic
markus@172
    62
        pEpCtNoEncryptedChannel = 0x02,
markus@172
    63
        pEpCtKeyNotFound = 0x03,
markus@172
    64
        pEpCtKeyExpired = 0x04,
markus@172
    65
        pEpCtKeyRevoked = 0x05,
markus@172
    66
        pEpCtKeyB0rken = 0x06,
markus@172
    67
        pEpCtMyKeyNotIncluded = 0x09,
vb@0
    68
markus@172
    69
        pEpCtSecurityByObscurity = 0x0a,
markus@172
    70
        pEpCtB0rkenCrypto = 0x0b,
markus@172
    71
        pEpCtKeyTooShort = 0x0c,
vb@0
    72
Dean@174
    73
        pEpCtCompromised = 0x0e,                 // known compromized connection
Dean@174
    74
        pEpCtMistrusted = 0x0f,                  // known mistrusted key
vb@0
    75
vb@0
    76
        // range 0x10 to 0x3f: unconfirmed encryption
vb@0
    77
markus@172
    78
        pEpCtUnconfirmedEncryption = 0x10,       // generic
Dean@174
    79
        pEpCtOpenPGPWeakUnconfirmed = 0x11,      // RSA 1024 is weak
vb@62
    80
Dean@174
    81
        pEpCtToBeChecked = 0x20,                 // generic
markus@172
    82
        pEpCtSMIMEUnconfirmed = 0x21,
markus@172
    83
        pEpCtCMSUnconfirmed = 0x22,
vb@62
    84
Dean@174
    85
        pEpCtStrongButUnconfirmed = 0x30,        // generic
markus@172
    86
        pEpCtOpenPGPUnconfirmed = 0x38,          // key at least 2048 bit RSA or EC
markus@172
    87
        pEpCtOTRUnconfirmed = 0x3a,
vb@0
    88
vb@0
    89
        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
vb@0
    90
Dean@174
    91
        pEpCtUnconfirmedEncAnon = 0x40,          // generic
markus@172
    92
        pEpCtpEpUnconfirmed = 0x7f,
vb@0
    93
Dean@174
    94
        pEpCtConfirmed = 0x80,                   // this bit decides if trust is confirmed
vb@0
    95
vb@0
    96
        // range 0x81 to 0x8f: reserved
vb@0
    97
        // range 0x90 to 0xbf: confirmed encryption
vb@0
    98
markus@172
    99
        pEpCtConfirmedEncryption = 0x90,         // generic
markus@172
   100
        pEpCtOpenPGPWeak = 0x91,                 // RSA 1024 is weak
vb@62
   101
Dean@174
   102
        pEpCtToBeCheckedConfirmed = 0xa0,        // generic
markus@172
   103
        pEpCtSMIME = 0xa1,
markus@172
   104
        pEpCtCMS = 0xa2,
vb@62
   105
markus@172
   106
        pEpCtStrongEncryption = 0xb0,            // generic
Dean@174
   107
        pEpCtOpenPGP = 0xb8,                     // key at least 2048 bit RSA or EC
markus@172
   108
        pEpCtOTR = 0xba,
vb@0
   109
vb@0
   110
        // range 0xc0 to 0xff: confirmed encryption and anonymization
vb@0
   111
Dean@174
   112
        pEpCtConfirmedEncAnon = 0xc0,            // generic
markus@172
   113
        pEpCtpEp = 0xff
markus@172
   114
    } pEpComType;
vb@0
   115
markus@172
   116
    [uuid(0CB90E62-8A6A-4CA0-99D7-481704051FF0)] struct pEpIdentity {
vb@0
   117
        BSTR address;
vb@0
   118
        BSTR fpr;
markus@177
   119
        BSTR userId;
vb@0
   120
        BSTR username;
markus@177
   121
        pEpComType commType;
vb@0
   122
        BSTR lang;
vb@0
   123
    };
markus@177
   124
    
markus@177
   125
    // Keymanagement API
markus@172
   126
    HRESULT StartKeyserverLookup();
markus@172
   127
    HRESULT StopKeyserverLookup();
vb@24
   128
markus@172
   129
    HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@172
   130
    HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@172
   131
    HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
markus@172
   132
    HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
markus@172
   133
    HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
vb@4
   134
vb@65
   135
    // Blacklist API
vb@65
   136
markus@172
   137
    HRESULT BlacklistAdd([in] BSTR fpr);
markus@172
   138
    HRESULT BlacklistDelete([in] BSTR fpr);
markus@172
   139
    HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
markus@172
   140
    HRESULT BlacklistRetreive([out, retval] SAFEARRAY(BSTR) *blacklist);
vb@65
   141
krista@157
   142
	// PGP compatibility functions
Dean@174
   143
markus@177
   144
	HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
krista@157
   145
vb@15
   146
    // Message API
vb@12
   147
markus@172
   148
	typedef [v1_enum] enum pEpRating {
markus@172
   149
		pEpRatingUndefined = 0,
markus@172
   150
		pEpRatingCannotDecrypt,
markus@172
   151
		pEpRatingHaveNoKey,
markus@172
   152
		pEpRatingUnencrypted,
markus@172
   153
		pEpRatingUnencryptedForSome,
markus@172
   154
		pEpRatingUnreliable,
markus@172
   155
		pEpRatingReliable,
markus@172
   156
		pEpRatingTrusted,
markus@172
   157
		pEpRatingTrustedAndAnonymized,
markus@172
   158
		pEpRatingFullyAnonymous,
markus@166
   159
markus@172
   160
		pEpRatingMistrust = -1,
markus@172
   161
		pEpRatingB0rken = -2,
markus@172
   162
		pEpRatingUnderAttack = -3
markus@172
   163
	} pEpRating;
markus@166
   164
markus@172
   165
	typedef [v1_enum] enum pEpColor {
markus@172
   166
		pEpColorNoColor = 0,
markus@172
   167
		pEpColorYellow,
markus@172
   168
		pEpColorGreen,
markus@172
   169
		pEpColorRed = -1,
markus@172
   170
	} pEpColor;
vb@33
   171
markus@167
   172
	typedef [v1_enum] enum pEpEncryptFlags {
markus@167
   173
		pEpEncryptFlagsNone = 0,
markus@167
   174
		pEpEncryptFlagForceEncryption = 0x1,
markus@167
   175
	} pEpEncryptFlags;
markus@167
   176
markus@167
   177
	typedef [v1_enum] enum pEpDecryptFlags {
markus@167
   178
		pEpDecryptFlagsNone = 0,
markus@167
   179
		pEpDecryptFlagOwnPrivateKey = 0x1
markus@167
   180
	} pEpDecryptFlags;
markus@167
   181
markus@172
   182
    typedef [v1_enum] enum pEpMsgDirection {
markus@172
   183
        pEpDirIncoming = 0,
markus@172
   184
        pEpDirOutgoing
markus@172
   185
    } pEpMsgDirection;
vb@33
   186
markus@171
   187
    [uuid(3A8A4F13-3402-4C4C-94AB-598D87869380)] struct StringPair {
vb@33
   188
        BSTR name;
vb@33
   189
        BSTR value;
vb@33
   190
    };
vb@33
   191
markus@172
   192
    [uuid(61DA7AD4-192E-4616-8678-B19AEFB45B45)] struct Blob {
vb@33
   193
        SAFEARRAY(BYTE) value;
markus@177
   194
        BSTR mimeType;
vb@33
   195
        BSTR filename;
vb@33
   196
    };
vb@33
   197
markus@172
   198
    [uuid(D763A8F3-BA23-4229-A037-1BB7BDC3E0C8)] struct TextMessage {
markus@172
   199
        pEpMsgDirection dir;
vb@33
   200
        BSTR id;
vb@33
   201
        BSTR shortmsg;
vb@33
   202
        BSTR longmsg;
markus@177
   203
        BSTR longmsgFormatted;
markus@172
   204
        SAFEARRAY(struct Blob) attachments;
markus@172
   205
        hyper sent; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@172
   206
        hyper recv; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@172
   207
        struct pEpIdentity from;
markus@172
   208
        SAFEARRAY(struct pEpIdentity) to;
markus@177
   209
        struct pEpIdentity recvBy;
markus@172
   210
        SAFEARRAY(struct pEpIdentity) cc;
markus@172
   211
        SAFEARRAY(struct pEpIdentity) bcc;
markus@177
   212
        SAFEARRAY(struct pEpIdentity) replyTo;
vb@33
   213
        SAFEARRAY(BSTR) references;
vb@33
   214
        SAFEARRAY(BSTR) keywords;
vb@33
   215
        BSTR comments;
markus@177
   216
        SAFEARRAY(struct StringPair) optFields;
vb@33
   217
    };
vb@33
   218
markus@172
   219
    HRESULT EncryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [in] SAFEARRAY(BSTR) extra, [in, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
markus@172
   220
    HRESULT DecryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [out] SAFEARRAY(BSTR) *keylist, [out] pEpDecryptFlags* flags, [out, retval] pEpRating *rating);
markus@177
   221
markus@172
   222
    HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
markus@172
   223
    HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
markus@172
   224
	HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
markus@84
   225
markus@177
   226
    // callback / keysync API
markus@177
   227
	HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
markus@177
   228
	HRESULT UnregisterCallbacks([in] IpEpEngineCallbacks* obsoleteCallback);
vb@8
   229
};
vb@4
   230
vb@8
   231
[
markus@172
   232
    uuid(564A4350-419E-47F1-B0DF-6FCCF0CD0BBC),
vb@0
   233
    version(1.0),
vb@0
   234
]
vb@0
   235
library pEpCOMServerAdapterLib
vb@0
   236
{
vb@0
   237
    importlib("stdole2.tlb");
markus@172
   238
    
vb@0
   239
    [
markus@172
   240
        uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
vb@0
   241
    ]
vb@0
   242
    coclass pEpEngine {
vb@0
   243
        [default] interface IpEpEngine;
vb@0
   244
    };
vb@0
   245
};