src/pgp_netpgp.h
author Edouard Tisserant <edouard@pep-project.org>
Tue, 06 Jun 2017 18:10:01 +0200
branchENGINE-179
changeset 1826 720922a950e9
parent 1677 e02c53c94550
child 1687 e376c005ff2d
child 2458 2dfe65bd3613
permissions -rw-r--r--
Closed ENGINE-179 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,
Edouard@174
    13
        char **ptext, size_t *psize, stringlist_t **keylist
Edouard@174
    14
    );
Edouard@174
    15
Edouard@174
    16
PEP_STATUS pgp_encrypt_and_sign(
Edouard@174
    17
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
Edouard@174
    18
        size_t psize, char **ctext, size_t *csize
Edouard@174
    19
    );
Edouard@174
    20
krista@1674
    21
krista@1674
    22
PEP_STATUS pgp_encrypt_only(
krista@1674
    23
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
krista@1674
    24
        size_t psize, char **ctext, size_t *csize
krista@1674
    25
    );
krista@1674
    26
krista@1674
    27
Edouard@174
    28
PEP_STATUS pgp_verify_text(
Edouard@174
    29
        PEP_SESSION session, const char *text, size_t size,
Edouard@174
    30
        const char *signature, size_t sig_size, stringlist_t **keylist
Edouard@174
    31
    );
Edouard@174
    32
Edouard@174
    33
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
Edouard@174
    34
Edouard@179
    35
PEP_STATUS pgp_export_keydata(
edouard@1677
    36
        PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
edouard@1677
    37
        bool secret
Edouard@174
    38
    );
Edouard@174
    39
Edouard@174
    40
PEP_STATUS pgp_find_keys(
Edouard@174
    41
        PEP_SESSION session, const char *pattern, stringlist_t **keylist
Edouard@174
    42
    );
Edouard@174
    43
krista@1030
    44
PEP_STATUS pgp_list_keyinfo(
krista@1033
    45
    PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
krista@1022
    46
    );
krista@1022
    47
Edouard@174
    48
PEP_STATUS pgp_generate_keypair(
Edouard@174
    49
        PEP_SESSION session, pEp_identity *identity
Edouard@174
    50
    );
Edouard@174
    51
Edouard@174
    52
PEP_STATUS pgp_get_key_rating(
Edouard@174
    53
        PEP_SESSION session,
Edouard@174
    54
        const char *fpr,
Edouard@174
    55
        PEP_comm_type *comm_type
Edouard@174
    56
    );
Edouard@174
    57
Edouard@179
    58
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
edouard@1677
    59
        size_t size, identity_list **private_idents);
Edouard@174
    60
Edouard@174
    61
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
Edouard@174
    62
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
Edouard@174
    63
Edouard@210
    64
PEP_STATUS pgp_renew_key(
Edouard@210
    65
        PEP_SESSION session,
Edouard@210
    66
        const char *fpr,
Edouard@210
    67
        const timestamp *ts
Edouard@210
    68
    );
Edouard@210
    69
Edouard@226
    70
PEP_STATUS pgp_revoke_key(
Edouard@226
    71
        PEP_SESSION session,
Edouard@226
    72
        const char *fpr,
Edouard@226
    73
        const char *reason
Edouard@226
    74
    );
Edouard@226
    75
Edouard@226
    76
PEP_STATUS pgp_key_expired(
Edouard@226
    77
        PEP_SESSION session,
Edouard@226
    78
        const char *fpr,
dirk@709
    79
        const time_t when,
Edouard@226
    80
        bool *expired
Edouard@226
    81
    );
Edouard@226
    82
Edouard@539
    83
PEP_STATUS pgp_key_revoked(
Edouard@539
    84
        PEP_SESSION session,
Edouard@539
    85
        const char *fpr,
Edouard@539
    86
        bool *revoked
Edouard@539
    87
    );
edouard@967
    88
edouard@967
    89
PEP_STATUS pgp_key_created(
edouard@967
    90
        PEP_SESSION session,
edouard@967
    91
        const char *fprstr,
edouard@967
    92
        time_t *created
edouard@967
    93
    );
edouard@967
    94
krista@1362
    95
PEP_STATUS pgp_contains_priv_key(
krista@1435
    96
    PEP_SESSION session,
krista@1362
    97
    const char *fpr,
krista@1362
    98
    bool *has_private);
krista@1362
    99
krista@1362
   100
PEP_STATUS pgp_find_private_keys(
krista@1362
   101
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
krista@1362
   102
);