src/cryptotech.h
author vb
Mon, 01 Sep 2014 17:50:28 +0200
changeset 25 5af1602f5c66
parent 24 50887c6ab78f
child 28 7fc9fc3e680c
permissions -rw-r--r--
bugfix: missing stddef.h
vb@23
     1
#pragma once
vb@23
     2
vb@23
     3
#include "pEpEngine.h"
vb@23
     4
vb@23
     5
typedef enum _PEP_cryptotech {
vb@23
     6
    PEP_crypt_none = 0,
vb@24
     7
    PEP_crypt_OpenPGP,
vb@24
     8
    //    PEP_ctypt_PEP,
vb@24
     9
    //    PEP_crypt_SMIME,
vb@24
    10
    //    PEP_crypt_CMS,
vb@23
    11
vb@23
    12
    PEP_crypt__count
vb@25
    13
} PEP_cryptotech;
vb@23
    14
vb@23
    15
typedef PEP_STATUS (*decrypt_and_verify_t)(
vb@23
    16
    PEP_SESSION session, const char *ctext, size_t csize,
vb@23
    17
    char **ptext, size_t *psize, stringlist_t **keylist
vb@23
    18
    );
vb@23
    19
vb@23
    20
typedef PEP_STATUS (*verify_text_t)(
vb@23
    21
    PEP_SESSION session, const char *text, size_t size,
vb@23
    22
    const char *signature, size_t sig_size, stringlist_t **keylist
vb@23
    23
    );
vb@23
    24
vb@23
    25
typedef PEP_STATUS (*encrypt_and_sign_t)(
vb@23
    26
    PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
vb@23
    27
    size_t psize, char **ctext, size_t *csize
vb@23
    28
    );
vb@23
    29
vb@24
    30
typedef PEP_STATUS (*delete_keypair_t)(PEP_SESSION session, const char *fpr);
vb@24
    31
vb@24
    32
typedef PEP_STATUS (*export_key_t)(
vb@24
    33
    PEP_SESSION session, const char *fpr, char **key_data, size_t *size
vb@24
    34
    );
vb@24
    35
vb@24
    36
typedef PEP_STATUS (*find_keys_t)(
vb@24
    37
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
vb@24
    38
    );
vb@24
    39
vb@24
    40
typedef PEP_STATUS (*generate_keypair_t)(
vb@24
    41
    PEP_SESSION session, pEp_identity *identity
vb@24
    42
    );
vb@24
    43
vb@24
    44
typedef PEP_STATUS (*get_key_rating_t)(
vb@24
    45
    PEP_SESSION session,
vb@24
    46
    const char *fpr,
vb@24
    47
    PEP_comm_type *comm_type
vb@24
    48
    );
vb@24
    49
vb@24
    50
typedef PEP_STATUS (*import_key_t)(PEP_SESSION session, const char *key_data, size_t size);
vb@24
    51
vb@24
    52
typedef PEP_STATUS (*recv_key_t)(PEP_SESSION session, const char *pattern);
vb@24
    53
vb@24
    54
typedef PEP_STATUS (*send_key_t)(PEP_SESSION session, const char *pattern);
vb@24
    55
vb@23
    56
typedef struct _PEP_cryptotech_t {
vb@23
    57
    uint8_t id;
vb@24
    58
    // the following are default values; comm_type may vary with key length or b0rken crypto
vb@24
    59
    uint8_t unconfirmed_comm_type;
vb@24
    60
    uint8_t confirmed_comm_type;
vb@23
    61
    decrypt_and_verify_t decrypt_and_verify;
vb@23
    62
    verify_text_t verify_text;
vb@23
    63
    encrypt_and_sign_t encrypt_and_sign;
vb@24
    64
    delete_keypair_t delete_keypair;
vb@24
    65
    export_key_t export_key;
vb@24
    66
    find_keys_t find_keys;
vb@24
    67
    generate_keypair_t generate_keypair;
vb@24
    68
    get_key_rating_t get_key_rating;
vb@24
    69
    import_key_t import_key;
vb@24
    70
    recv_key_t recv_key;
vb@24
    71
    send_key_t send_key;
vb@23
    72
} PEP_cryptotech_t;
vb@23
    73
vb@23
    74
typedef uint64_t cryptotech_mask;