src/pgp_netpgp.h
author Dirk Zimmermann <dz@pep.security>
Thu, 11 Apr 2019 10:46:46 +0200
branchIOS-1482
changeset 3505 3fe4b41696d3
parent 3131 44dbae32fe45
child 3719 6806be48b327
permissions -rw-r--r--
IOS-1482 close branch
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
Edouard@174
     3
#pragma once
Edouard@174
     4
Edouard@174
     5
#include "pEpEngine.h"
Edouard@174
     6
Edouard@174
     7
PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
Edouard@174
     8
void pgp_release(PEP_SESSION session, bool out_last);
Edouard@174
     9
Edouard@174
    10
PEP_STATUS pgp_decrypt_and_verify(
Edouard@174
    11
        PEP_SESSION session, const char *ctext, size_t csize,
krista@1435
    12
        const char *dsigtext, size_t dsigsize,
krista@2978
    13
        char **ptext, size_t *psize, stringlist_t **keylist,
krista@2978
    14
        char** filename_ptr // will be ignored
Edouard@174
    15
    );
Edouard@174
    16
Edouard@174
    17
PEP_STATUS pgp_encrypt_and_sign(
Edouard@174
    18
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
Edouard@174
    19
        size_t psize, char **ctext, size_t *csize
Edouard@174
    20
    );
Edouard@174
    21
krista@1674
    22
krista@1674
    23
PEP_STATUS pgp_encrypt_only(
krista@1674
    24
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
krista@1674
    25
        size_t psize, char **ctext, size_t *csize
krista@1674
    26
    );
krista@1674
    27
krista@3131
    28
PEP_STATUS pgp_sign_only(
krista@3131
    29
        PEP_SESSION session, const char* fpr, const char *ptext,
krista@3131
    30
        size_t psize, char **stext, size_t *ssize
krista@3131
    31
    );
krista@1674
    32
Edouard@174
    33
PEP_STATUS pgp_verify_text(
Edouard@174
    34
        PEP_SESSION session, const char *text, size_t size,
Edouard@174
    35
        const char *signature, size_t sig_size, stringlist_t **keylist
Edouard@174
    36
    );
Edouard@174
    37
Edouard@174
    38
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
Edouard@174
    39
Edouard@179
    40
PEP_STATUS pgp_export_keydata(
edouard@1677
    41
        PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
edouard@1677
    42
        bool secret
Edouard@174
    43
    );
Edouard@174
    44
Edouard@174
    45
PEP_STATUS pgp_find_keys(
Edouard@174
    46
        PEP_SESSION session, const char *pattern, stringlist_t **keylist
Edouard@174
    47
    );
Edouard@174
    48
krista@1030
    49
PEP_STATUS pgp_list_keyinfo(
krista@1033
    50
    PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
krista@1022
    51
    );
krista@1022
    52
Edouard@174
    53
PEP_STATUS pgp_generate_keypair(
Edouard@174
    54
        PEP_SESSION session, pEp_identity *identity
Edouard@174
    55
    );
Edouard@174
    56
Edouard@174
    57
PEP_STATUS pgp_get_key_rating(
Edouard@174
    58
        PEP_SESSION session,
Edouard@174
    59
        const char *fpr,
Edouard@174
    60
        PEP_comm_type *comm_type
Edouard@174
    61
    );
Edouard@174
    62
Edouard@179
    63
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
edouard@1677
    64
        size_t size, identity_list **private_idents);
Edouard@174
    65
Edouard@174
    66
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
Edouard@174
    67
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
Edouard@174
    68
Edouard@210
    69
PEP_STATUS pgp_renew_key(
Edouard@210
    70
        PEP_SESSION session,
Edouard@210
    71
        const char *fpr,
Edouard@210
    72
        const timestamp *ts
Edouard@210
    73
    );
Edouard@210
    74
Edouard@226
    75
PEP_STATUS pgp_revoke_key(
Edouard@226
    76
        PEP_SESSION session,
Edouard@226
    77
        const char *fpr,
Edouard@226
    78
        const char *reason
Edouard@226
    79
    );
Edouard@226
    80
Edouard@226
    81
PEP_STATUS pgp_key_expired(
Edouard@226
    82
        PEP_SESSION session,
Edouard@226
    83
        const char *fpr,
dirk@709
    84
        const time_t when,
Edouard@226
    85
        bool *expired
Edouard@226
    86
    );
Edouard@226
    87
Edouard@539
    88
PEP_STATUS pgp_key_revoked(
Edouard@539
    89
        PEP_SESSION session,
Edouard@539
    90
        const char *fpr,
Edouard@539
    91
        bool *revoked
Edouard@539
    92
    );
edouard@967
    93
edouard@967
    94
PEP_STATUS pgp_key_created(
edouard@967
    95
        PEP_SESSION session,
edouard@967
    96
        const char *fprstr,
edouard@967
    97
        time_t *created
edouard@967
    98
    );
edouard@967
    99
krista@1362
   100
PEP_STATUS pgp_contains_priv_key(
krista@1435
   101
    PEP_SESSION session,
krista@1362
   102
    const char *fpr,
krista@1362
   103
    bool *has_private);
krista@1362
   104
krista@1362
   105
PEP_STATUS pgp_find_private_keys(
krista@1362
   106
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
krista@1362
   107
);
krista@2458
   108
krista@2458
   109
// Stub - just returns PEP_STATUS_OK, as netpgp isn't sufficient to do this.
krista@2458
   110
PEP_STATUS pgp_import_ultimately_trusted_keypairs(PEP_SESSION session);