src/cryptotech.h
author vb
Mon, 01 Sep 2014 13:02:23 +0200
changeset 23 dba569e54163
child 24 50887c6ab78f
permissions -rw-r--r--
adding the concepts of transports and cryptotech
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@23
     7
    PEP_crypt_OpenPGP = 0x2f,
vb@23
     8
//    PEP_ctypt_PEP = 0x6f,
vb@23
     9
//    PEP_crypt_SMIME = 0x10,
vb@23
    10
//    PEP_crypt_CMS = 0x20,
vb@23
    11
vb@23
    12
    PEP_crypt__count
vb@23
    13
};
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@23
    30
typedef struct _PEP_cryptotech_t {
vb@23
    31
    uint8_t id;
vb@23
    32
    decrypt_and_verify_t decrypt_and_verify;
vb@23
    33
    verify_text_t verify_text;
vb@23
    34
    encrypt_and_sign_t encrypt_and_sign;
vb@23
    35
} PEP_cryptotech_t;
vb@23
    36
vb@23
    37
typedef uint64_t cryptotech_mask;