pEpCOMServerAdapter.idl
author Volker Birk <vb@pep-project.org>
Thu, 16 Apr 2015 20:43:31 +0200
changeset 0 0aa9866d751c
child 4 fdd8cf02d2cc
permissions -rw-r--r--
initial commit
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
[
vb@0
    12
    object,
vb@0
    13
    uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
vb@0
    14
    oleautomation,
vb@0
    15
    nonextensible,
vb@0
    16
    pointer_default(unique)
vb@0
    17
]
vb@0
    18
interface IpEpEngine : IUnknown {
vb@0
    19
    typedef enum _pEp_STATUS {
vb@0
    20
        pEp_STATUS_OK = 0,
vb@0
    21
vb@0
    22
        pEp_KEY_NOT_FOUND = 0x0201,
vb@0
    23
        pEp_KEY_HAS_AMBIG_NAME = 0x0202,
vb@0
    24
        pEp_GET_KEY_FAILED = 0x0203,
vb@0
    25
vb@0
    26
        pEp_UNENCRYPTED = 0x0400,
vb@0
    27
        pEp_VERIFIED = 0x0401,
vb@0
    28
        pEp_DECRYPTED = 0x0402,
vb@0
    29
        pEp_DECRYPTED_AND_VERIFIED = 0x0403,
vb@0
    30
        pEp_DECRYPT_WRONG_FORMAT = 0x0404,
vb@0
    31
        pEp_DECRYPT_NO_KEY = 0x0405,
vb@0
    32
        pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
vb@0
    33
        pEp_VERIFY_NO_KEY = 0x0407,
vb@0
    34
        pEp_VERIFIED_AND_TRUSTED = 0x0408,
vb@0
    35
vb@0
    36
        pEp_ILLEGAL_VALUE = -4,
vb@0
    37
        pEp_BUFFER_TOO_SMALL = -3,
vb@0
    38
        pEp_OUT_OF_MEMORY = -2,
vb@0
    39
        pEp_UNKNOWN_ERROR = -1
vb@0
    40
    } pEp_STATUS;
vb@0
    41
vb@0
    42
    [id(1)] HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
vb@0
    43
    [id(2)] HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
vb@0
    44
    [id(3)] HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
vb@0
    45
    [id(4)] HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
vb@0
    46
    [id(5)] HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
vb@0
    47
    [id(21)] HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
vb@0
    48
    [id(6)] HRESULT safeword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
vb@0
    49
    [id(7)] HRESULT safewords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
vb@0
    50
vb@0
    51
    typedef enum _pEp_comm_type {
vb@0
    52
        pEp_ct_unknown = 0,
vb@0
    53
vb@0
    54
        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
vb@0
    55
vb@0
    56
        pEp_ct_no_encryption = 0x01,                // generic
vb@0
    57
        pEp_ct_no_encrypted_channel = 0x02,
vb@0
    58
        pEp_ct_key_not_found = 0x03,
vb@0
    59
        pEp_ct_key_expired = 0x04,
vb@0
    60
        pEp_ct_key_revoked = 0x05,
vb@0
    61
        pEp_ct_key_b0rken = 0x06,
vb@0
    62
        pEp_ct_my_key_not_included = 0x09,
vb@0
    63
vb@0
    64
        pEp_ct_security_by_obscurity = 0x0a,
vb@0
    65
        pEp_ct_b0rken_crypto = 0x0b,
vb@0
    66
        pEp_ct_key_too_short = 0x0e,
vb@0
    67
vb@0
    68
        pEp_ct_compromized = 0x0f,                  // known compromized connection
vb@0
    69
vb@0
    70
        // range 0x10 to 0x3f: unconfirmed encryption
vb@0
    71
vb@0
    72
        pEp_ct_unconfirmed_encryption = 0x10,       // generic
vb@0
    73
        pEp_ct_OpenPGP_1024_RSA_unconfirmed = 0x11,	// RSA 1024 is weak
vb@0
    74
        pEp_ct_OpenPGP_unconfirmed = 0x3f,          // key at least 2048 bit RSA
vb@0
    75
        // or 1024 bit DSA
vb@0
    76
vb@0
    77
        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
vb@0
    78
vb@0
    79
        pEp_ct_unconfirmed_enc_anon = 0x40,         // generic
vb@0
    80
        pEp_ct_pEp_unconfirmed = 0x7f,
vb@0
    81
vb@0
    82
        pEp_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
vb@0
    83
vb@0
    84
        // range 0x81 to 0x8f: reserved
vb@0
    85
        // range 0x90 to 0xbf: confirmed encryption
vb@0
    86
vb@0
    87
        pEp_ct_confirmed_encryption = 0x90,         // generic
vb@0
    88
        pEp_ct_OpenPGP_1024_RSA = 0x91, // RSA 1024 is weak
vb@0
    89
        pEp_ct_OpenPGP = 0xbf, // key at least 2048 bit RSA or 1024 bit DSA
vb@0
    90
vb@0
    91
        // range 0xc0 to 0xff: confirmed encryption and anonymization
vb@0
    92
vb@0
    93
        pEp_ct_confirmed_enc_anon = 0xc0,           // generic
vb@0
    94
        pEp_ct_pEp = 0xff
vb@0
    95
    } pEp_comm_type;
vb@0
    96
vb@0
    97
    struct pEp_identity_s {
vb@0
    98
        BSTR address;
vb@0
    99
        BSTR fpr;
vb@0
   100
        BSTR user_id;
vb@0
   101
        BSTR username;
vb@0
   102
        pEp_comm_type comm_type;
vb@0
   103
        BSTR lang;
vb@0
   104
    };
vb@0
   105
vb@0
   106
    [id(8)] HRESULT get_identity([in] BSTR address, [out, retval] struct pEp_identity_s * ident);
vb@0
   107
    [id(9)] HRESULT set_identity([in] struct pEp_identity_s * ident);
vb@0
   108
    [id(10)] HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
vb@0
   109
    [id(11)] HRESULT delete_keypair([in] BSTR fpr);
vb@0
   110
    [id(12)] HRESULT import_key([in] BSTR key_data);
vb@0
   111
    [id(13)] HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
vb@0
   112
    [id(14)] HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
vb@0
   113
    [id(15)] HRESULT recv_key([in] BSTR pattern);
vb@0
   114
    [id(16)] HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
vb@0
   115
    [id(17)] HRESULT send_key([in] BSTR pattern);
vb@0
   116
vb@0
   117
    [id(19)] HRESULT examine_identity([in] struct pEp_identity_s * ident);
vb@0
   118
    [id(20)] HRESULT examine_myself([in] struct pEp_identity_s * myself);
vb@0
   119
    [id(22)] HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
vb@0
   120
    [id(23)] HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
vb@0
   121
};
vb@0
   122
[
vb@0
   123
    uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
vb@0
   124
    version(1.0),
vb@0
   125
]
vb@0
   126
library pEpCOMServerAdapterLib
vb@0
   127
{
vb@0
   128
    importlib("stdole2.tlb");
vb@0
   129
    [
vb@0
   130
        uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
vb@0
   131
    ]
vb@0
   132
    dispinterface _IpEpEngineEvents
vb@0
   133
    {
vb@0
   134
    properties:
vb@0
   135
    methods:
vb@0
   136
    };
vb@0
   137
    [
vb@0
   138
        uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
vb@0
   139
    ]
vb@0
   140
    coclass pEpEngine {
vb@0
   141
        [default] interface IpEpEngine;
vb@0
   142
        [default, source] dispinterface _IpEpEngineEvents;
vb@0
   143
    };
vb@0
   144
};
vb@0
   145