pEpCOMServerAdapter.idl
author Volker Birk <vb@pep-project.org>
Fri, 24 Apr 2015 00:00:37 +0200
changeset 5 d959f594e4f7
parent 4 fdd8cf02d2cc
child 8 6fe51215f252
permissions -rw-r--r--
...
     1 // pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
     2 //
     3 
     4 // This file will be processed by the MIDL tool to
     5 // produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
     6 
     7 import "oaidl.idl";
     8 import "ocidl.idl";
     9 
    10 interface IMessageAPI_Outlook;
    11 
    12 [
    13     object,
    14     uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
    15     oleautomation,
    16     nonextensible,
    17     pointer_default(unique)
    18 ]
    19 interface IpEpEngine : IUnknown {
    20     typedef enum _pEp_STATUS {
    21         pEp_STATUS_OK = 0,
    22 
    23         pEp_KEY_NOT_FOUND = 0x0201,
    24         pEp_KEY_HAS_AMBIG_NAME = 0x0202,
    25         pEp_GET_KEY_FAILED = 0x0203,
    26 
    27         pEp_UNENCRYPTED = 0x0400,
    28         pEp_VERIFIED = 0x0401,
    29         pEp_DECRYPTED = 0x0402,
    30         pEp_DECRYPTED_AND_VERIFIED = 0x0403,
    31         pEp_DECRYPT_WRONG_FORMAT = 0x0404,
    32         pEp_DECRYPT_NO_KEY = 0x0405,
    33         pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
    34         pEp_VERIFY_NO_KEY = 0x0407,
    35         pEp_VERIFIED_AND_TRUSTED = 0x0408,
    36 
    37         pEp_ILLEGAL_VALUE = -4,
    38         pEp_BUFFER_TOO_SMALL = -3,
    39         pEp_OUT_OF_MEMORY = -2,
    40         pEp_UNKNOWN_ERROR = -1
    41     } pEp_STATUS;
    42 
    43     HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
    44     HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
    45     HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
    46     HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
    47     HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
    48     HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
    49     HRESULT safeword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
    50     HRESULT safewords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
    51 
    52     typedef enum _pEp_comm_type {
    53         pEp_ct_unknown = 0,
    54 
    55         // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
    56 
    57         pEp_ct_no_encryption = 0x01,                // generic
    58         pEp_ct_no_encrypted_channel = 0x02,
    59         pEp_ct_key_not_found = 0x03,
    60         pEp_ct_key_expired = 0x04,
    61         pEp_ct_key_revoked = 0x05,
    62         pEp_ct_key_b0rken = 0x06,
    63         pEp_ct_my_key_not_included = 0x09,
    64 
    65         pEp_ct_security_by_obscurity = 0x0a,
    66         pEp_ct_b0rken_crypto = 0x0b,
    67         pEp_ct_key_too_short = 0x0e,
    68 
    69         pEp_ct_compromized = 0x0f,                  // known compromized connection
    70 
    71         // range 0x10 to 0x3f: unconfirmed encryption
    72 
    73         pEp_ct_unconfirmed_encryption = 0x10,       // generic
    74         pEp_ct_OpenPGP_1024_RSA_unconfirmed = 0x11,	// RSA 1024 is weak
    75         pEp_ct_OpenPGP_unconfirmed = 0x3f,          // key at least 2048 bit RSA
    76         // or 1024 bit DSA
    77 
    78         // range 0x40 to 0x7f: unconfirmed encryption and anonymization
    79 
    80         pEp_ct_unconfirmed_enc_anon = 0x40,         // generic
    81         pEp_ct_pEp_unconfirmed = 0x7f,
    82 
    83         pEp_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
    84 
    85         // range 0x81 to 0x8f: reserved
    86         // range 0x90 to 0xbf: confirmed encryption
    87 
    88         pEp_ct_confirmed_encryption = 0x90,         // generic
    89         pEp_ct_OpenPGP_1024_RSA = 0x91, // RSA 1024 is weak
    90         pEp_ct_OpenPGP = 0xbf, // key at least 2048 bit RSA or 1024 bit DSA
    91 
    92         // range 0xc0 to 0xff: confirmed encryption and anonymization
    93 
    94         pEp_ct_confirmed_enc_anon = 0xc0,           // generic
    95         pEp_ct_pEp = 0xff
    96     } pEp_comm_type;
    97 
    98     struct pEp_identity_s {
    99         BSTR address;
   100         BSTR fpr;
   101         BSTR user_id;
   102         BSTR username;
   103         pEp_comm_type comm_type;
   104         BSTR lang;
   105     };
   106 
   107     HRESULT get_identity([in] BSTR address, [out, retval] struct pEp_identity_s * ident);
   108     HRESULT set_identity([in] struct pEp_identity_s * ident);
   109     HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
   110     HRESULT delete_keypair([in] BSTR fpr);
   111     HRESULT import_key([in] BSTR key_data);
   112     HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
   113     HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
   114     HRESULT recv_key([in] BSTR pattern);
   115     HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
   116     HRESULT send_key([in] BSTR pattern);
   117 
   118     HRESULT examine_identity([in] struct pEp_identity_s * ident);
   119     HRESULT examine_myself([in] struct pEp_identity_s * myself);
   120     HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   121     HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   122 };
   123 
   124 [
   125     object,
   126     uuid(BC9AB54D-2CDA-47A5-AB40-64857B9E9555),
   127     oleautomation,
   128     nonextensible,
   129     pointer_default(unique)
   130 ]
   131 interface IMessageAPI_Outlook : IUnknown {
   132     typedef enum _pEp_text_format {
   133         pEp_text_format_plain = 0,
   134         pEp_text_format_html,
   135         pEp_text_format_other = 0xff
   136     } pEp_text_format;
   137 
   138     typedef enum _pEp_msg_direction {
   139         pEp_dir_incoming = 0,
   140         pEp_dir_outgoing
   141     } pEp_msg_direction;
   142 
   143     typedef enum _pEp_MIME_format {
   144         pEp_MIME_none = 0,                      // message is not MIME encoded
   145         pEp_MIME_fields_omitted,                // message content but no fields
   146         pEp_MIME                                // message is fully MIME encoded
   147     } pEp_MIME_format;
   148 
   149     typedef enum _pEp_enc_format {
   150         pEp_enc_none = 0,                       // message is not encrypted
   151         pEp_enc_pieces,                         // inline PGP + PGP extensions
   152         pEp_enc_S_MIME,                         // RFC5751
   153         pEp_enc_PGP_MIME,                       // RFC3156
   154         pEp_enc_pEp                             // pEp encryption format
   155     } pEp_enc_format;
   156 
   157     HRESULT key_compromized([in] BSTR fpr);
   158 };
   159 
   160 [
   161     uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
   162     version(1.0),
   163 ]
   164 library pEpCOMServerAdapterLib
   165 {
   166     importlib("stdole2.tlb");
   167     [
   168         uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
   169     ]
   170     dispinterface _IpEpEngineEvents
   171     {
   172     properties:
   173     methods:
   174     };
   175     [
   176         uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
   177     ]
   178     coclass pEpEngine {
   179         [default] interface IpEpEngine;
   180         [default, source] dispinterface _IpEpEngineEvents;
   181         interface IMessageAPI_Outlook;
   182     };
   183 };
   184