pEpCOMServerAdapter.idl
changeset 0 0aa9866d751c
child 4 fdd8cf02d2cc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pEpCOMServerAdapter.idl	Thu Apr 16 20:43:31 2015 +0200
     1.3 @@ -0,0 +1,145 @@
     1.4 +// pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
     1.5 +//
     1.6 +
     1.7 +// This file will be processed by the MIDL tool to
     1.8 +// produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
     1.9 +
    1.10 +import "oaidl.idl";
    1.11 +import "ocidl.idl";
    1.12 +
    1.13 +
    1.14 +[
    1.15 +    object,
    1.16 +    uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
    1.17 +    oleautomation,
    1.18 +    nonextensible,
    1.19 +    pointer_default(unique)
    1.20 +]
    1.21 +interface IpEpEngine : IUnknown {
    1.22 +    typedef enum _pEp_STATUS {
    1.23 +        pEp_STATUS_OK = 0,
    1.24 +
    1.25 +        pEp_KEY_NOT_FOUND = 0x0201,
    1.26 +        pEp_KEY_HAS_AMBIG_NAME = 0x0202,
    1.27 +        pEp_GET_KEY_FAILED = 0x0203,
    1.28 +
    1.29 +        pEp_UNENCRYPTED = 0x0400,
    1.30 +        pEp_VERIFIED = 0x0401,
    1.31 +        pEp_DECRYPTED = 0x0402,
    1.32 +        pEp_DECRYPTED_AND_VERIFIED = 0x0403,
    1.33 +        pEp_DECRYPT_WRONG_FORMAT = 0x0404,
    1.34 +        pEp_DECRYPT_NO_KEY = 0x0405,
    1.35 +        pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
    1.36 +        pEp_VERIFY_NO_KEY = 0x0407,
    1.37 +        pEp_VERIFIED_AND_TRUSTED = 0x0408,
    1.38 +
    1.39 +        pEp_ILLEGAL_VALUE = -4,
    1.40 +        pEp_BUFFER_TOO_SMALL = -3,
    1.41 +        pEp_OUT_OF_MEMORY = -2,
    1.42 +        pEp_UNKNOWN_ERROR = -1
    1.43 +    } pEp_STATUS;
    1.44 +
    1.45 +    [id(1)] HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
    1.46 +    [id(2)] HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
    1.47 +    [id(3)] HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
    1.48 +    [id(4)] HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
    1.49 +    [id(5)] HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
    1.50 +    [id(21)] HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
    1.51 +    [id(6)] HRESULT safeword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
    1.52 +    [id(7)] HRESULT safewords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
    1.53 +
    1.54 +    typedef enum _pEp_comm_type {
    1.55 +        pEp_ct_unknown = 0,
    1.56 +
    1.57 +        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
    1.58 +
    1.59 +        pEp_ct_no_encryption = 0x01,                // generic
    1.60 +        pEp_ct_no_encrypted_channel = 0x02,
    1.61 +        pEp_ct_key_not_found = 0x03,
    1.62 +        pEp_ct_key_expired = 0x04,
    1.63 +        pEp_ct_key_revoked = 0x05,
    1.64 +        pEp_ct_key_b0rken = 0x06,
    1.65 +        pEp_ct_my_key_not_included = 0x09,
    1.66 +
    1.67 +        pEp_ct_security_by_obscurity = 0x0a,
    1.68 +        pEp_ct_b0rken_crypto = 0x0b,
    1.69 +        pEp_ct_key_too_short = 0x0e,
    1.70 +
    1.71 +        pEp_ct_compromized = 0x0f,                  // known compromized connection
    1.72 +
    1.73 +        // range 0x10 to 0x3f: unconfirmed encryption
    1.74 +
    1.75 +        pEp_ct_unconfirmed_encryption = 0x10,       // generic
    1.76 +        pEp_ct_OpenPGP_1024_RSA_unconfirmed = 0x11,	// RSA 1024 is weak
    1.77 +        pEp_ct_OpenPGP_unconfirmed = 0x3f,          // key at least 2048 bit RSA
    1.78 +        // or 1024 bit DSA
    1.79 +
    1.80 +        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
    1.81 +
    1.82 +        pEp_ct_unconfirmed_enc_anon = 0x40,         // generic
    1.83 +        pEp_ct_pEp_unconfirmed = 0x7f,
    1.84 +
    1.85 +        pEp_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
    1.86 +
    1.87 +        // range 0x81 to 0x8f: reserved
    1.88 +        // range 0x90 to 0xbf: confirmed encryption
    1.89 +
    1.90 +        pEp_ct_confirmed_encryption = 0x90,         // generic
    1.91 +        pEp_ct_OpenPGP_1024_RSA = 0x91, // RSA 1024 is weak
    1.92 +        pEp_ct_OpenPGP = 0xbf, // key at least 2048 bit RSA or 1024 bit DSA
    1.93 +
    1.94 +        // range 0xc0 to 0xff: confirmed encryption and anonymization
    1.95 +
    1.96 +        pEp_ct_confirmed_enc_anon = 0xc0,           // generic
    1.97 +        pEp_ct_pEp = 0xff
    1.98 +    } pEp_comm_type;
    1.99 +
   1.100 +    struct pEp_identity_s {
   1.101 +        BSTR address;
   1.102 +        BSTR fpr;
   1.103 +        BSTR user_id;
   1.104 +        BSTR username;
   1.105 +        pEp_comm_type comm_type;
   1.106 +        BSTR lang;
   1.107 +    };
   1.108 +
   1.109 +    [id(8)] HRESULT get_identity([in] BSTR address, [out, retval] struct pEp_identity_s * ident);
   1.110 +    [id(9)] HRESULT set_identity([in] struct pEp_identity_s * ident);
   1.111 +    [id(10)] HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
   1.112 +    [id(11)] HRESULT delete_keypair([in] BSTR fpr);
   1.113 +    [id(12)] HRESULT import_key([in] BSTR key_data);
   1.114 +    [id(13)] HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
   1.115 +    [id(14)] HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
   1.116 +    [id(15)] HRESULT recv_key([in] BSTR pattern);
   1.117 +    [id(16)] HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
   1.118 +    [id(17)] HRESULT send_key([in] BSTR pattern);
   1.119 +
   1.120 +    [id(19)] HRESULT examine_identity([in] struct pEp_identity_s * ident);
   1.121 +    [id(20)] HRESULT examine_myself([in] struct pEp_identity_s * myself);
   1.122 +    [id(22)] HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   1.123 +    [id(23)] HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   1.124 +};
   1.125 +[
   1.126 +    uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
   1.127 +    version(1.0),
   1.128 +]
   1.129 +library pEpCOMServerAdapterLib
   1.130 +{
   1.131 +    importlib("stdole2.tlb");
   1.132 +    [
   1.133 +        uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
   1.134 +    ]
   1.135 +    dispinterface _IpEpEngineEvents
   1.136 +    {
   1.137 +    properties:
   1.138 +    methods:
   1.139 +    };
   1.140 +    [
   1.141 +        uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
   1.142 +    ]
   1.143 +    coclass pEpEngine {
   1.144 +        [default] interface IpEpEngine;
   1.145 +        [default, source] dispinterface _IpEpEngineEvents;
   1.146 +    };
   1.147 +};
   1.148 +