pEpCOMServerAdapter.idl
author Thomas
Fri, 22 Nov 2019 09:35:43 +0100
branchsync
changeset 378 4e1795946472
parent 375 fe31c63ea77d
child 383 eecca51a4ff0
permissions -rw-r--r--
Update hgignore
vb@338
     1
// pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
vb@338
     2
//
vb@338
     3
vb@338
     4
// This file will be processed by the MIDL tool to
vb@338
     5
// produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
vb@338
     6
vb@338
     7
import "oaidl.idl";
vb@338
     8
import "ocidl.idl";
vb@338
     9
vb@338
    10
[
vb@338
    11
    object,
vb@338
    12
    uuid(4DA92647-A858-448E-B01F-BE4DCB8C86A1),
vb@338
    13
    oleautomation,
vb@338
    14
    nonextensible,
vb@338
    15
    pointer_default(unique)
vb@338
    16
]
vb@338
    17
interface IpEpEngineCallbacks : IUnknown {
vb@338
    18
    typedef [v1_enum] enum SyncHandshakeSignal {
vb@338
    19
        SyncNotifyUndefined = 0,
vb@338
    20
vb@338
    21
        // request show handshake dialog
vb@338
    22
        SyncNotifyInitAddOurDevice = 1,
vb@338
    23
        SyncNotifyInitAddOtherDevice = 2,
vb@338
    24
        SyncNotifyInitFormGroup = 3,
vb@338
    25
        // SyncNotifyInitMoveOurDevice = 4,
vb@338
    26
vb@338
    27
        // handshake process timed out
vb@338
    28
        SyncNotifyTimeout = 5,
vb@338
    29
vb@338
    30
        // handshake accepted by user
vb@338
    31
        SyncNotifyAcceptedDeviceAdded = 6,
vb@338
    32
        SyncNotifyAcceptedGroupCreated = 7,
Thomas@373
    33
        SyncNotifyAcceptedDeviceAccepted = 8,
vb@338
    34
vb@338
    35
        // handshake dialog must be closed
Thomas@373
    36
        // SyncNotifyOvertaken = 9,
vb@338
    37
Thomas@373
    38
        // forming group
Thomas@373
    39
        // SyncNotifyFormingGroup = 10,
Thomas@356
    40
Thomas@373
    41
        // notificaton of actual group status
Thomas@373
    42
        SyncNotifySole = 254,
Thomas@373
    43
        SyncNotifyInGroup = 255
vb@338
    44
    } SyncHandshakeSignal;
vb@338
    45
vb@338
    46
    [id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
vb@338
    47
vb@338
    48
    [id(2)] HRESULT NotifyHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [in] SyncHandshakeSignal signal);
vb@338
    49
};
vb@338
    50
vb@338
    51
[
vb@338
    52
    object,
vb@338
    53
    uuid(045E49AF-0975-4876-A53B-8CA5AB28C0F8),
vb@338
    54
    oleautomation,
vb@338
    55
    nonextensible,
vb@338
    56
    pointer_default(unique)
vb@338
    57
]
vb@338
    58
interface IpEpEngine : IUnknown {
vb@338
    59
Thomas@373
    60
    // runtime config of the adapter
vb@338
    61
Thomas@373
    62
    [id(1)] HRESULT VerboseLogging([in] VARIANT_BOOL enable);
vb@338
    63
Thomas@373
    64
    // runtime config of the engine
vb@338
    65
Thomas@373
    66
    [id(2)] HRESULT PassiveMode([in] VARIANT_BOOL enable);
Thomas@373
    67
    [id(3)] HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
vb@338
    68
Thomas@373
    69
    // basic API
vb@338
    70
Thomas@373
    71
    [id(4)] HRESULT ExportKey([in] BSTR fpr, [out, retval] BSTR * keyData);
Thomas@373
    72
    [id(5)] HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
Thomas@373
    73
    [id(6)] HRESULT Trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
Thomas@373
    74
    [id(7)] HRESULT GetTrustwords([in] struct pEpIdentity * id1, [in] struct pEpIdentity * id2, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] VARIANT_BOOL full, [out, retval] BSTR * words);
Thomas@373
    75
    [id(8)] HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
Thomas@373
    76
    [id(9)] HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
Thomas@373
    77
    [id(10)] HRESULT GetLanguageList([out, retval] BSTR * languages);
vb@338
    78
Thomas@373
    79
    typedef [v1_enum] enum pEpComType {
Thomas@373
    80
        pEpCtUnknown = 0,
vb@338
    81
Thomas@373
    82
        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
vb@338
    83
Thomas@373
    84
        pEpCtNoEncryption = 0x01,                // generic
Thomas@373
    85
        pEpCtNoEncryptedChannel = 0x02,
Thomas@373
    86
        pEpCtKeyNotFound = 0x03,
Thomas@373
    87
        pEpCtKeyExpired = 0x04,
Thomas@373
    88
        pEpCtKeyRevoked = 0x05,
Thomas@373
    89
        pEpCtKeyB0rken = 0x06,
Thomas@373
    90
        pEpCtMyKeyNotIncluded = 0x09,
vb@338
    91
Thomas@373
    92
        pEpCtSecurityByObscurity = 0x0a,
Thomas@373
    93
        pEpCtB0rkenCrypto = 0x0b,
Thomas@373
    94
        pEpCtKeyTooShort = 0x0c,
vb@338
    95
Thomas@373
    96
        pEpCtCompromised = 0x0e,                 // known compromized connection
Thomas@373
    97
        pEpCtMistrusted = 0x0f,                  // known mistrusted key
vb@338
    98
Thomas@373
    99
        // range 0x10 to 0x3f: unconfirmed encryption
vb@338
   100
Thomas@373
   101
        pEpCtUnconfirmedEncryption = 0x10,       // generic
Thomas@373
   102
        pEpCtOpenPGPWeakUnconfirmed = 0x11,      // RSA 1024 is weak
vb@338
   103
Thomas@373
   104
        pEpCtToBeChecked = 0x20,                 // generic
Thomas@373
   105
        pEpCtSMIMEUnconfirmed = 0x21,
Thomas@373
   106
        pEpCtCMSUnconfirmed = 0x22,
vb@338
   107
Thomas@373
   108
        pEpCtStrongButUnconfirmed = 0x30,        // generic
Thomas@373
   109
        pEpCtOpenPGPUnconfirmed = 0x38,          // key at least 2048 bit RSA or EC
Thomas@373
   110
        pEpCtOTRUnconfirmed = 0x3a,
vb@338
   111
Thomas@373
   112
        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
vb@338
   113
Thomas@373
   114
        pEpCtUnconfirmedEncAnon = 0x40,          // generic
Thomas@373
   115
        pEpCtpEpUnconfirmed = 0x7f,
vb@338
   116
Thomas@373
   117
        pEpCtConfirmed = 0x80,                   // this bit decides if trust is confirmed
vb@338
   118
Thomas@373
   119
        // range 0x81 to 0x8f: reserved
Thomas@373
   120
        // range 0x90 to 0xbf: confirmed encryption
vb@338
   121
Thomas@373
   122
        pEpCtConfirmedEncryption = 0x90,         // generic
Thomas@373
   123
        pEpCtOpenPGPWeak = 0x91,                 // RSA 1024 is weak
vb@338
   124
Thomas@373
   125
        pEpCtToBeCheckedConfirmed = 0xa0,        // generic
Thomas@373
   126
        pEpCtSMIME = 0xa1,
Thomas@373
   127
        pEpCtCMS = 0xa2,
vb@338
   128
Thomas@373
   129
        pEpCtStrongEncryption = 0xb0,            // generic
Thomas@373
   130
        pEpCtOpenPGP = 0xb8,                     // key at least 2048 bit RSA or EC
Thomas@373
   131
        pEpCtOTR = 0xba,
vb@338
   132
Thomas@373
   133
        // range 0xc0 to 0xff: confirmed encryption and anonymization
vb@338
   134
Thomas@373
   135
        pEpCtConfirmedEncAnon = 0xc0,            // generic
Thomas@373
   136
        pEpCtpEp = 0xff
Thomas@373
   137
    } pEpComType;
vb@338
   138
Thomas@373
   139
    typedef enum pEpStatus {
Thomas@373
   140
        pEpStatusOk = 0,
vb@338
   141
Thomas@373
   142
        pEpInitCannotLoadGpgme = 0x0110,
Thomas@373
   143
        pEpInitGpgmeInitFailed = 0x0111,
Thomas@373
   144
        pEpInitNoGpgHome = 0x0112,
Thomas@373
   145
        pEpInitNetpgpInitFailed = 0x0113,
Thomas@373
   146
        pEpInitCannotDetermineGpgVersion = 0x0114,
Thomas@373
   147
        pEpInitUnsupportedGpgVersion = 0x0115,
Thomas@373
   148
        pEpInitCannotConfigGpgAgent = 0x0116,
vb@338
   149
Thomas@373
   150
        pEpInitSqlite3WithoutMutex = 0x0120,
Thomas@373
   151
        pEpInitCannotOpenDb = 0x0121,
Thomas@373
   152
        pEpInitCannotOpenSystemDb = 0x0122,
vb@338
   153
Thomas@373
   154
        pEpKeyNotFound = 0x0201,
Thomas@373
   155
        pEpKeyHasAmbigName = 0x0202,
Thomas@373
   156
        pEpGetKeyFailed = 0x0203,
Thomas@373
   157
        pEpCannotExportKey = 0x0204,
Thomas@373
   158
        pEpCannotEditKey = 0x0205,
Thomas@373
   159
        pEpKeyUnsuitable = 0x0206,
vb@338
   160
Thomas@373
   161
        pEpCannotFindIdentity = 0x0301,
Thomas@373
   162
        pEpCannotSetPerson = 0x0381,
Thomas@373
   163
        pEpCannotSetPgpKeypair = 0x0382,
Thomas@373
   164
        pEpCannotSetIdentity = 0x0383,
Thomas@373
   165
        pEpCannotSetTrust = 0x0384,
Thomas@373
   166
        pEpKeyBlacklisted = 0x0385,
Thomas@373
   167
        pEpCannotFindPerson = 0x0386,
vb@338
   168
Thomas@373
   169
        pEpCannotFindAlias = 0x0391,
Thomas@373
   170
        pEpCannotSetAlias = 0x0392,
vb@338
   171
Thomas@373
   172
        pEpUnencrypted = 0x0400,
Thomas@373
   173
        pEpVerified = 0x0401,
Thomas@373
   174
        pEpDecrypted = 0x0402,
Thomas@373
   175
        pEpDecryptedAndVerified = 0x0403,
Thomas@373
   176
        pEpDecryptWrongFormat = 0x0404,
Thomas@373
   177
        pEpDecryptNoKey = 0x0405,
Thomas@373
   178
        pEpDecryptSignatureDoesNotMatch = 0x0406,
Thomas@373
   179
        pEpVerifyNoKey = 0x0407,
Thomas@373
   180
        pEpVerifiedAndTrusted = 0x0408,
Thomas@373
   181
        pEpCannotDecryptUnknown = 0x04ff,
vb@338
   182
Thomas@373
   183
        pEpTrustwordNotFound = 0x0501,
Thomas@373
   184
        pEpTrustwordsFprWrongLength = 0x0502,
Thomas@373
   185
        pEpTrustwordsDuplicateFpr = 0x0503,
vb@338
   186
Thomas@373
   187
        pEpCannotCreateKey = 0x0601,
Thomas@373
   188
        pEpCannotSendKey = 0x0602,
vb@338
   189
Thomas@373
   190
        pEpPhraseNotFound = 0x0701,
vb@338
   191
Thomas@373
   192
        pEpSendFunctionNotRegistered = 0x0801,
Thomas@373
   193
        pEpContraintsViolated = 0x0802,
Thomas@373
   194
        pEpCannotEncode = 0x0803,
vb@338
   195
Thomas@373
   196
        pEpSyncNoNotifyCallback = 0x0901,
Thomas@373
   197
        pEpSyncIllegalMessage = 0x0902,
Thomas@373
   198
        pEpSyncNoInjectCallback = 0x0903,
vb@338
   199
Thomas@373
   200
        pEpSequenceViolated = 0x0970,
Thomas@373
   201
        pEpCannotIncreaseSequence = 0x0971,
Thomas@373
   202
        pEpCannotSetSequenceValue = 0x0972,
Thomas@373
   203
        pEpOwnSequence = 0x097f,
vb@338
   204
Thomas@373
   205
        pEpSyncStatemachineError = 0x0980,
Thomas@373
   206
        pEpSyncNoTrust = 0x0981,
Thomas@373
   207
        pEpStatemachineInvalidState = 0x0982,
Thomas@373
   208
        pEpStatemachineInvalidEvent = 0x0983,
Thomas@373
   209
        pEpStatemachineInvalidCondition = 0x0984,
Thomas@373
   210
        pEpStatemachineInvalidAction = 0x0985,
Thomas@373
   211
        pEpStatemachineInhibitedEvent = 0x0986,
vb@338
   212
Thomas@373
   213
        pEpCommitFailed = 0xff01,
Thomas@373
   214
        pEpMessageConsume = 0xff02,
Thomas@373
   215
        pEpMessageIgnore = 0xff03,
vb@338
   216
Thomas@373
   217
        pEpRecordNotFound = -6,
Thomas@373
   218
        pEpCannotCreateTempFile = -5,
Thomas@373
   219
        pEpIllegalValue = -4,
Thomas@373
   220
        pEpBufferTooSmall = -3,
Thomas@373
   221
        pEpOutOfMemory = -2,
Thomas@373
   222
        pEpUnknownError = -1,
vb@338
   223
Thomas@373
   224
        pEpVersionMismatch = -7,
Thomas@373
   225
    } pEpStatus;
vb@338
   226
Thomas@373
   227
    typedef [v1_enum] enum pEpIdentityFlags {
Thomas@373
   228
        pEpIdfNone = 0,
Thomas@373
   229
        pEpIdfNotForSync = 0x0001,
Thomas@373
   230
        pEpIdfList = 0x0002,
Thomas@373
   231
        pEpIdfDevicegroup = 0x0100
Thomas@373
   232
    } pEpIdentityFlags;
vb@338
   233
Thomas@373
   234
    [uuid(C3A3814E-567F-4D1C-9F44-9B1DA3957A89)] struct pEpIdentity {
Thomas@373
   235
        BSTR Address;
Thomas@373
   236
        BSTR Fpr;
Thomas@373
   237
        BSTR UserId;
Thomas@373
   238
        BSTR UserName;
Thomas@373
   239
        pEpComType CommType;
Thomas@373
   240
        BSTR Lang;
Thomas@373
   241
        VARIANT_BOOL Me;
Thomas@373
   242
        pEpIdentityFlags Flags;
Thomas@373
   243
    };
vb@338
   244
Thomas@373
   245
    [id(11)] HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
Thomas@373
   246
    [id(12)] HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
vb@338
   247
Thomas@373
   248
    // Keymanagement API
vb@338
   249
Thomas@373
   250
    [id(13)] HRESULT StartKeyserverLookup();
Thomas@373
   251
    [id(14)] HRESULT StopKeyserverLookup();
vb@338
   252
Thomas@373
   253
    [id(15)] HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
Thomas@373
   254
    [id(16)] HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
Thomas@373
   255
    [id(17)] HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
Thomas@373
   256
    [id(18)] HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
Thomas@373
   257
    [id(19)] HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
Thomas@373
   258
    [id(20)] HRESULT OwnIdentitiesRetrieve([out, retval] SAFEARRAY(struct pEpIdentity)* ownIdentities);
Thomas@373
   259
    // [id(21)] HRESULT UndoLastMistrust(); NOT IMPLEMENTED ANY MORE - USE KeyResetTrust() instead
Thomas@373
   260
    [id(22)] HRESULT IspEpUser([in] struct pEpIdentity *ident, [out, retval] VARIANT_BOOL *ispEp);
vb@338
   261
Thomas@373
   262
    // Blacklist API
Thomas@373
   263
    
Thomas@373
   264
    [id(23)] HRESULT BlacklistAdd([in] BSTR fpr);
Thomas@373
   265
    [id(24)] HRESULT BlacklistDelete([in] BSTR fpr);
Thomas@373
   266
    [id(25)] HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
Thomas@373
   267
    [id(26)] HRESULT BlacklistRetrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
vb@338
   268
Thomas@373
   269
    // PGP compatibility functions
vb@338
   270
Thomas@373
   271
    [id(27)] HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
vb@338
   272
Thomas@373
   273
    // Message API
vb@338
   274
Thomas@373
   275
    typedef [v1_enum] enum pEpRating {
Thomas@373
   276
        pEpRatingUndefined = 0,
Thomas@373
   277
        pEpRatingCannotDecrypt,
Thomas@373
   278
        pEpRatingHaveNoKey,
Thomas@373
   279
        pEpRatingUnencrypted,
Thomas@373
   280
        pEpRatingUnencryptedForSome,
Thomas@373
   281
        pEpRatingUnreliable,
Thomas@373
   282
        pEpRatingReliable,
Thomas@373
   283
        pEpRatingTrusted,
Thomas@373
   284
        pEpRatingTrustedAndAnonymized,
Thomas@373
   285
        pEpRatingFullyAnonymous,
vb@338
   286
Thomas@373
   287
        pEpRatingMistrust = -1,
Thomas@373
   288
        pEpRatingB0rken = -2,
Thomas@373
   289
        pEpRatingUnderAttack = -3
Thomas@373
   290
    } pEpRating;
vb@338
   291
Thomas@373
   292
    typedef [v1_enum] enum pEpColor {
Thomas@373
   293
        pEpColorNoColor = 0,
Thomas@373
   294
        pEpColorYellow,
Thomas@373
   295
        pEpColorGreen,
Thomas@373
   296
        pEpColorRed = -1,
Thomas@373
   297
    } pEpColor;
vb@338
   298
Thomas@373
   299
    typedef [v1_enum] enum pEpEncryptFlags {
Thomas@373
   300
        pEpEncryptFlagDefault = 0,
Thomas@373
   301
        pEpEncryptFlagForceEncryption = 0x1,
vb@338
   302
Thomas@373
   303
        // This flag is for special uses and should not be used
Thomas@373
   304
        // by normal pEp clients!
Thomas@373
   305
        pEpEncryptFlagForceUnsigned = 0x2,
vb@338
   306
Thomas@373
   307
        // This flag is for special uses and should not be used
Thomas@373
   308
        // by normal pEp clients!
Thomas@373
   309
        pEpEncryptFlagForceNoAttachedKey = 0x4,
vb@338
   310
Thomas@373
   311
        //This is mainly used by pEp clients to send private keys to 
Thomas@373
   312
        // their own PGP-only device
Thomas@373
   313
        pEpEncryptFlagForceVersion1 = 0x16
Thomas@373
   314
    } pEpEncryptFlags;
vb@338
   315
Thomas@373
   316
    typedef [v1_enum] enum pEpDecryptFlags {
Thomas@373
   317
        pEpDecryptFlagsNone = 0,
Thomas@373
   318
        pEpDecryptFlagOwnPrivateKey = 0x1,
Thomas@373
   319
        pEpDecryptFlagConsume = 0x2,
Thomas@373
   320
        pEpDecryptFlagIgnore = 0x4,
Thomas@373
   321
        pEpDecryptFlagSrcModified = 0x8,
Thomas@373
   322
        pEpDecryptFlagUntrustedServer = 0x100
Thomas@373
   323
    } pEpDecryptFlags;
vb@338
   324
Thomas@373
   325
    typedef [v1_enum] enum pEpMsgDirection {
Thomas@373
   326
        pEpDirIncoming = 0,
Thomas@373
   327
        pEpDirOutgoing
Thomas@373
   328
    } pEpMsgDirection;
vb@338
   329
Thomas@373
   330
    typedef [v1_enum] enum pEpEncFormat {
Thomas@373
   331
        pEpEncNone = 0,                       // message is not encrypted
Thomas@373
   332
        pEpEncPieces,                         // inline PGP + PGP extensions
Thomas@373
   333
        pEpEncSMime,                          // RFC5751
Thomas@373
   334
        pEpEncPgpMime,                        // RFC3156
Thomas@373
   335
        pEpEncPep,                            // pEp encryption format
Thomas@373
   336
        pEpEncPgpMimeOutlook1                 // Message B0rken by Outlook type 1
Thomas@373
   337
    } pEpEncFormat;
vb@338
   338
Thomas@373
   339
    [uuid(47FB0795-6B64-455C-BB0E-54998CAB8ACB)] struct StringPair {
Thomas@373
   340
        BSTR Name;
Thomas@373
   341
        BSTR Value;
Thomas@373
   342
    };
vb@338
   343
Thomas@373
   344
    [uuid(634EB7CE-99AA-460D-BDF8-F7CDA7232CA6)] struct Blob {
Thomas@373
   345
        SAFEARRAY(BYTE) value;
Thomas@373
   346
        BSTR MimeType;
Thomas@373
   347
        BSTR Filename;
Thomas@373
   348
    };
vb@338
   349
Thomas@373
   350
    [uuid(B6F40887-E761-4A47-B204-A0193EE0284D)] struct TextMessage {
Thomas@373
   351
        pEpMsgDirection Dir;
Thomas@373
   352
        BSTR Id;
Thomas@373
   353
        BSTR ShortMsg;
Thomas@373
   354
        BSTR LongMsg;
Thomas@373
   355
        BSTR LongMsgFormatted;
Thomas@373
   356
        SAFEARRAY(struct Blob) Attachments;
Thomas@373
   357
        hyper Sent; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
Thomas@373
   358
        hyper Recv; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
Thomas@373
   359
        struct pEpIdentity From;
Thomas@373
   360
        SAFEARRAY(struct pEpIdentity) To;
Thomas@373
   361
        struct pEpIdentity RecvBy;
Thomas@373
   362
        SAFEARRAY(struct pEpIdentity) Cc;
Thomas@373
   363
        SAFEARRAY(struct pEpIdentity) Bcc;
Thomas@373
   364
        SAFEARRAY(struct pEpIdentity) ReplyTo;
Thomas@373
   365
        SAFEARRAY(BSTR) References;
Thomas@373
   366
        SAFEARRAY(BSTR) Keywords;
Thomas@373
   367
        BSTR Comments;
Thomas@373
   368
        SAFEARRAY(struct StringPair) OptFields;
Thomas@373
   369
        [readonly] BSTR SenderFpr;
Thomas@373
   370
    };
vb@338
   371
Thomas@373
   372
    [id(28)] HRESULT EncryptMessage(
Thomas@373
   373
        [in, out] struct TextMessage *src,
Thomas@373
   374
        [out] struct TextMessage * dst,
Thomas@373
   375
        [in] SAFEARRAY(BSTR) extra,
Thomas@373
   376
        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags,
Thomas@373
   377
        // Use pEpEncFormat.pEpEncNone for unencrypted, outgoing messages.
Thomas@373
   378
        // Default is pEpEncFormat.pEpEncPep, all other formats are only 
Thomas@373
   379
        // for compatibility and not intended for normal use.
Thomas@373
   380
        [in, defaultvalue(pEpEncPep)] pEpEncFormat encFormat);
vb@338
   381
Thomas@373
   382
    [id(29)] HRESULT DecryptMessage(
Thomas@373
   383
        [in, out] struct TextMessage *src,
Thomas@373
   384
        [out] struct TextMessage * dst,
Thomas@373
   385
        [in, out] SAFEARRAY(BSTR) *keylist,
Thomas@373
   386
        [in, out] pEpDecryptFlags* flags,
Thomas@373
   387
        [out, retval] pEpRating *rating);
vb@338
   388
Thomas@373
   389
    [id(30)] HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
Thomas@373
   390
    [id(31)] HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
Thomas@373
   391
    [id(32)] HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
vb@338
   392
Thomas@373
   393
    [id(33)] HRESULT GetMessageTrustwords(
Thomas@373
   394
        [in] struct TextMessage *msg,
Thomas@373
   395
        [in] struct pEpIdentity * receivedBy,
Thomas@373
   396
        [in] SAFEARRAY(BSTR) keylist,
Thomas@373
   397
        [in, defaultvalue("en")] BSTR lang,
Thomas@373
   398
        [in, defaultvalue(0)] VARIANT_BOOL full,
Thomas@373
   399
        [out, retval] BSTR * words
Thomas@373
   400
    );
vb@338
   401
Thomas@373
   402
    [id(34)] HRESULT EncryptMessageForSelf(
Thomas@373
   403
        [in] struct pEpIdentity* targetId,
Thomas@373
   404
        [in] struct TextMessage* src,
Thomas@373
   405
        [in] SAFEARRAY(BSTR) extra, // Fingerprints for extra keys for encryption.
Thomas@373
   406
        [out] struct TextMessage* dst,
Thomas@373
   407
        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags
Thomas@373
   408
    );
vb@338
   409
Thomas@373
   410
    [id(35)] HRESULT ReEvaluateMessageRating(
Thomas@373
   411
        [in] struct TextMessage *src,
Thomas@373
   412
        [in] SAFEARRAY(BSTR) x_KeyList, // referring to X-KeyList mail header
Thomas@373
   413
        [in] pEpRating x_EncStatus, // referring to X-EncStatus mail header
Thomas@373
   414
        [out, retval] pEpRating *rating
Thomas@373
   415
    );
vb@338
   416
Thomas@373
   417
    // callback / keysync API
Thomas@373
   418
    [id(36)] HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
Thomas@373
   419
    [id(37)] HRESULT UnregisterCallbacks();
vb@338
   420
Thomas@373
   421
    // mark imported keys as trusted
vb@338
   422
Thomas@373
   423
    [id(38)] HRESULT SetOwnKey(
Thomas@373
   424
        [in] struct pEpIdentity * ident,
Thomas@373
   425
        [in] BSTR fpr,
Thomas@373
   426
        [out, retval] struct pEpIdentity * result
Thomas@373
   427
    );
vb@338
   428
Thomas@373
   429
    [id(39)] HRESULT EncryptMessageAndAddPrivKey(
Thomas@373
   430
        [in] struct TextMessage *src,
Thomas@373
   431
        [out] struct TextMessage * dst,
Thomas@373
   432
        [in] BSTR to_fpr,
Thomas@373
   433
        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags,
Thomas@373
   434
        // Use pEpEncFormat.pEpEncNone for unencrypted, outgoing messages.
Thomas@373
   435
        // Default is pEpEncFormat.pEpEncPep, all other formats are only 
Thomas@373
   436
        // for compatibility and not intended for normal use.
Thomas@373
   437
        [in, defaultvalue(pEpEncPep)] pEpEncFormat encFormat);
vb@338
   438
Thomas@373
   439
    // Trigger an immediate update check.
Thomas@373
   440
    [id(40)] HRESULT UpdateNow([in] BSTR productCode, [out] VARIANT_BOOL *didUpdate);
vb@338
   441
Thomas@373
   442
    // Get a preview of the outgoint message rating
Thomas@373
   443
    [id(41)] HRESULT OutgoingMessageRatingPreview([in] struct TextMessage *msg, [out, retval] pEpRating *rating);
vb@338
   444
Thomas@373
   445
    // Trust own public key. To be used for manual key import.
Thomas@373
   446
    [id(42)] HRESULT TrustOwnKey([in] struct pEpIdentity * ident);
vb@338
   447
Thomas@373
   448
    // Engine startup and shutdown
Thomas@373
   449
    [id(43)] HRESULT Startup();
vb@338
   450
Thomas@373
   451
    // Get the rating for a specific key
Thomas@373
   452
    [id(44)] HRESULT GetKeyRatingForUser([in] BSTR userId, [in] BSTR fpr, [out, retval] pEpRating *rating);
vb@338
   453
Thomas@373
   454
    // Resets the database status for a key
Thomas@373
   455
    [id(45)] HRESULT KeyResetIdentity([in] struct pEpIdentity ident, [in] BSTR fpr);
vb@338
   456
Thomas@373
   457
    // Resets the default database status for the user / keypair provided
Thomas@373
   458
    [id(46)] HRESULT KeyResetUser([in] BSTR userId, [in] BSTR fpr);
vb@338
   459
Thomas@373
   460
    // revoke and mistrust all own keys, generate new keys for all own identities, and opportunistically communicate
Thomas@373
   461
    // key reset information to people we have recently contacted. 
Thomas@373
   462
    [id(47)] HRESULT KeyResetAllOwnKeys();
vb@338
   463
Thomas@373
   464
    // sync API
vb@338
   465
Thomas@373
   466
    typedef [v1_enum] enum SyncHandshakeResult {
Thomas@373
   467
        SyncHandshakeCancel = -1,
Thomas@373
   468
        SyncHandshakeAccepted = 0,
Thomas@373
   469
        SyncHandshakeRejected = 1
Thomas@373
   470
    } SyncHandshakeResult;
vb@338
   471
Thomas@373
   472
    [id(48)] HRESULT DeliverHandshakeResult([in] enum SyncHandshakeResult result, [in] SAFEARRAY(struct pEpIdentity) identities_sharing);
Thomas@342
   473
Thomas@373
   474
    // Imports keys from data
Thomas@373
   475
    [id(49)] HRESULT ImportKey([in] BSTR keyData, [out] SAFEARRAY(struct pEpIdentity)* privateKeys);
Thomas@343
   476
Thomas@373
   477
    typedef [v1_enum] enum pEpCipherSuite {
Thomas@373
   478
        pEpCipherSuiteDefault = 0,
Thomas@373
   479
        pEpCipherSuiteCV25519 = 1,
Thomas@373
   480
        pEpCipherSuiteP256 = 2,
Thomas@373
   481
        pEpCipherSuiteP384 = 3,
Thomas@373
   482
        pEpCipherSuiteP521 = 4,
Thomas@373
   483
        pEpCipherSuiteRSA2K = 5,
Thomas@373
   484
        pEpCipherSuiteRSA3K = 6,
Thomas@373
   485
        pEpCipherSuiteRSA4K = 7,
Thomas@373
   486
        pEpCipherSuiteRSA8K = 8
Thomas@373
   487
    } pEpCipherSuite;
Thomas@343
   488
Thomas@373
   489
    // Sets the cipher suite
Thomas@373
   490
    [id(50)] HRESULT ConfigCipherSuite([in, defaultvalue(pEpCipherSuiteDefault)] pEpCipherSuite cipherSuite);
Thomas@344
   491
Thomas@373
   492
    // Leave the device group
Thomas@373
   493
    [id(51)] HRESULT LeaveDeviceGroup();
Thomas@348
   494
Thomas@373
   495
    // Get Trustwords for a pair of fprs
Thomas@373
   496
    [id(52)] HRESULT GetTrustwordsForFprs([in] BSTR fpr1, [in] BSTR fpr2, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] VARIANT_BOOL full, [out, retval] BSTR * words);
Thomas@349
   497
Thomas@373
   498
    // Get the comm type a bare key has
Thomas@373
   499
    [id(53)] HRESULT GetKeyRating([in] BSTR fpr, [out, retval] pEpComType *commType);
Thomas@352
   500
Thomas@373
   501
    // Decode a Sync message from PER into XER
Thomas@373
   502
    [id(54)] HRESULT PERToXERSyncMessage([in] struct TextMessage *msg, [out, retval] BSTR *xer);
Thomas@357
   503
Thomas@373
   504
    // Disable Sync for this identity
Thomas@373
   505
    [id(55)] HRESULT DisableIdentityForSync([in] struct pEpIdentity * ident);
Thomas@357
   506
Thomas@373
   507
    // Enable Sync for this identity
Thomas@373
   508
    [id(56)] HRESULT EnableIdentityForSync([in] struct pEpIdentity * ident);
Thomas@358
   509
Thomas@373
   510
    // Gets the directory where shared files are stored
Thomas@373
   511
    [id(57)] HRESULT PerMachineDirectory([out, retval] BSTR *directory);
Thomas@358
   512
Thomas@373
   513
    // Gets the directory for user files
Thomas@365
   514
    [id(58)] HRESULT PerUserDirectory([out, retval] BSTR *directory);
Thomas@365
   515
Thomas@365
   516
    // Converts a comm type to a pEp rating
Thomas@365
   517
    [id(59)] HRESULT RatingFromCommType([in] pEpComType commType, [out, retval] pEpRating * rating);
Thomas@374
   518
Thomas@374
   519
    // Gets if sync is enabled
Thomas@374
   520
    [id(60)] HRESULT GetIsSyncRunning([out, retval] VARIANT_BOOL *running);
Thomas@375
   521
Thomas@375
   522
    // Shuts down sync
Thomas@375
   523
    [id(61)] HRESULT ShutDownSync();
vb@338
   524
};
vb@338
   525
vb@338
   526
[
vb@338
   527
    uuid(564A4350-419E-47F1-B0DF-6FCCF0CD0BBC),
vb@338
   528
    version(1.0),
vb@338
   529
]
vb@338
   530
library pEpCOMServerAdapterLib
vb@338
   531
{
vb@338
   532
    importlib("stdole2.tlb");
vb@338
   533
vb@338
   534
    [
vb@338
   535
        uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
vb@338
   536
    ]
vb@338
   537
    coclass pEpEngine {
vb@338
   538
        [default] interface IpEpEngine;
vb@338
   539
        interface IpEpEngineCallbacks;
vb@338
   540
    };
vb@338
   541
};