src/cryptotech.c
author vb
Mon, 01 Sep 2014 17:44:19 +0200
changeset 24 50887c6ab78f
parent 23 dba569e54163
child 28 7fc9fc3e680c
permissions -rw-r--r--
...
     1 #include "cryptotech.h"
     2 
     3 #ifdef NO_GPG
     4 #include "pgp_netpgp.h"
     5 #else
     6 #include "pgp_gpg.h"
     7 #endif
     8 
     9 #include <stdlib.h>
    10 #include <memory.h>
    11 #include <assert.h>
    12 
    13 PEP_STATUS init_cryptotech(PEP_cryptotech_t *cryptotech)
    14 {
    15     assert(PEP_crypt__count == 2);
    16     memset(cryptotech, 0, sizeof(PEP_cryptotech_t) * PEP_crypt__count);
    17 
    18     cryptotech[0].id = PEP_crypt_none;
    19     cryptotech[0].unconfirmed_comm_type = PEP_ct_no_encryption;
    20     cryptotech[0].confirmed_comm_type = PEP_ct_no_encryption;
    21 
    22     cryptotech[1].id = PEP_crypt_OpenPGP;
    23     cryptotech[1].unconfirmed_comm_type = PEP_ct_OpenPGP_unconfirmed;
    24     cryptotech[1].confirmed_comm_type = PEP_ct_OpenPGP;
    25     cryptotech[1].decrypt_and_verify = pgp_decrypt_and_verify;
    26     cryptotech[1].encrypt_and_sign = pgp_encrypt_and_sign;
    27     cryptotech[1].verify_text = pgp_verify_text;
    28     cryptotech[1].delete_keypair = pgp_delete_keypair;
    29     cryptotech[1].export_key = pgp_export_key;
    30     cryptotech[1].find_keys = pgp_find_keys;
    31     cryptotech[1].generate_keypair = pgp_generate_keypair;
    32     cryptotech[1].get_key_rating = pgp_get_key_rating;
    33     cryptotech[1].import_key = pgp_import_key;
    34     cryptotech[1].recv_key = pgp_recv_key;
    35     cryptotech[1].send_key = pgp_send_key;
    36 
    37     return PEP_STATUS_OK;
    38 }