src/pgp_gpg.h
author Krista Grothoff <krista@pep-project.org>
Fri, 10 Mar 2017 15:23:31 +0100
branchENGINE-172
changeset 1639 be84d676f3ef
parent 1513 e7f7e42385b5
child 1673 559931685411
child 1924 c40a363fae45
permissions -rw-r--r--
gpg and internal API changes for ENGINE-172 implemented and tested (no-sign); no-key not in yet
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@24
     4
#pragma once
vb@24
     5
vb@24
     6
#include "pEpEngine.h"
vb@24
     7
vb@62
     8
PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
vb@62
     9
void pgp_release(PEP_SESSION session, bool out_last);
vb@24
    10
vb@24
    11
PEP_STATUS pgp_decrypt_and_verify(
vb@49
    12
        PEP_SESSION session, const char *ctext, size_t csize,
krista@1397
    13
        const char *dsigtext, size_t dsigsize,
vb@49
    14
        char **ptext, size_t *psize, stringlist_t **keylist
vb@24
    15
    );
vb@24
    16
vb@24
    17
PEP_STATUS pgp_encrypt_and_sign(
vb@49
    18
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
vb@49
    19
        size_t psize, char **ctext, size_t *csize
vb@24
    20
    );
vb@24
    21
krista@1639
    22
PEP_STATUS pgp_encrypt_only(
krista@1639
    23
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
krista@1639
    24
        size_t psize, char **ctext, size_t *csize
krista@1639
    25
    );
krista@1639
    26
krista@1639
    27
vb@24
    28
PEP_STATUS pgp_verify_text(
vb@49
    29
        PEP_SESSION session, const char *text, size_t size,
vb@49
    30
        const char *signature, size_t sig_size, stringlist_t **keylist
vb@24
    31
    );
vb@24
    32
vb@24
    33
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
vb@24
    34
Edouard@170
    35
PEP_STATUS pgp_export_keydata(
vb@1103
    36
        PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
vb@1103
    37
        bool secret
vb@24
    38
    );
vb@24
    39
vb@24
    40
PEP_STATUS pgp_find_keys(
vb@49
    41
        PEP_SESSION session, const char *pattern, stringlist_t **keylist
vb@24
    42
    );
vb@24
    43
krista@1030
    44
PEP_STATUS pgp_list_keyinfo(
krista@1030
    45
    PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
krista@1030
    46
    );
krista@1030
    47
vb@24
    48
PEP_STATUS pgp_generate_keypair(
vb@49
    49
        PEP_SESSION session, pEp_identity *identity
vb@24
    50
    );
vb@24
    51
vb@24
    52
PEP_STATUS pgp_get_key_rating(
vb@74
    53
        PEP_SESSION session,
vb@74
    54
        const char *fpr,
vb@74
    55
        PEP_comm_type *comm_type
vb@24
    56
    );
vb@24
    57
Edouard@170
    58
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
Edouard@728
    59
                              size_t size, identity_list **private_idents);
Edouard@728
    60
Edouard@728
    61
PEP_STATUS pgp_import_private_keydata(PEP_SESSION session, const char *key_data,
Edouard@728
    62
                                      size_t size, identity_list **private_idents);
vb@24
    63
vb@24
    64
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
vb@200
    65
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
vb@201
    66
vb@201
    67
PEP_STATUS pgp_renew_key(
vb@201
    68
        PEP_SESSION session,
vb@201
    69
        const char *fpr,
vb@201
    70
        const timestamp *ts
vb@201
    71
    );
vb@201
    72
vb@211
    73
PEP_STATUS pgp_revoke_key(
vb@211
    74
        PEP_SESSION session,
vb@211
    75
        const char *fpr,
vb@211
    76
        const char *reason
vb@211
    77
    );
vb@24
    78
vb@214
    79
PEP_STATUS pgp_key_expired(
vb@214
    80
        PEP_SESSION session,
vb@214
    81
        const char *fpr,
Edouard@701
    82
        const time_t when,
vb@214
    83
        bool *expired
vb@214
    84
    );
vb@214
    85
Edouard@662
    86
PEP_STATUS pgp_key_revoked(
Edouard@662
    87
        PEP_SESSION session,
Edouard@662
    88
        const char *fpr,
Edouard@662
    89
        bool *revoked
Edouard@662
    90
    );
Edouard@662
    91
vb@958
    92
PEP_STATUS pgp_key_created(
vb@958
    93
        PEP_SESSION session,
vb@958
    94
        const char *fpr,
vb@958
    95
        time_t *created
vb@958
    96
    );
vb@958
    97
krista@1357
    98
PEP_STATUS pgp_contains_priv_key(
krista@1357
    99
        PEP_SESSION session, 
krista@1357
   100
        const char *fpr,
krista@1357
   101
        bool *has_private);
krista@1357
   102
krista@1357
   103
PEP_STATUS pgp_find_private_keys(
krista@1357
   104
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
krista@1357
   105
);
krista@1357
   106
vb@507
   107
PEP_STATUS pgp_binary(const char **path);
vb@507
   108
#define PGP_BINARY_PATH pgp_binary