src/pgp_gpg.h
author Volker Birk <vb@pep.foundation>
Tue, 27 Dec 2016 21:13:41 +0100
changeset 1513 e7f7e42385b5
parent 1397 0a64816a6e37
child 1639 be84d676f3ef
permissions -rw-r--r--
adding license info to each file
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
vb@24
    22
PEP_STATUS pgp_verify_text(
vb@49
    23
        PEP_SESSION session, const char *text, size_t size,
vb@49
    24
        const char *signature, size_t sig_size, stringlist_t **keylist
vb@24
    25
    );
vb@24
    26
vb@24
    27
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
vb@24
    28
Edouard@170
    29
PEP_STATUS pgp_export_keydata(
vb@1103
    30
        PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
vb@1103
    31
        bool secret
vb@24
    32
    );
vb@24
    33
vb@24
    34
PEP_STATUS pgp_find_keys(
vb@49
    35
        PEP_SESSION session, const char *pattern, stringlist_t **keylist
vb@24
    36
    );
vb@24
    37
krista@1030
    38
PEP_STATUS pgp_list_keyinfo(
krista@1030
    39
    PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
krista@1030
    40
    );
krista@1030
    41
vb@24
    42
PEP_STATUS pgp_generate_keypair(
vb@49
    43
        PEP_SESSION session, pEp_identity *identity
vb@24
    44
    );
vb@24
    45
vb@24
    46
PEP_STATUS pgp_get_key_rating(
vb@74
    47
        PEP_SESSION session,
vb@74
    48
        const char *fpr,
vb@74
    49
        PEP_comm_type *comm_type
vb@24
    50
    );
vb@24
    51
Edouard@170
    52
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
Edouard@728
    53
                              size_t size, identity_list **private_idents);
Edouard@728
    54
Edouard@728
    55
PEP_STATUS pgp_import_private_keydata(PEP_SESSION session, const char *key_data,
Edouard@728
    56
                                      size_t size, identity_list **private_idents);
vb@24
    57
vb@24
    58
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
vb@200
    59
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
vb@201
    60
vb@201
    61
PEP_STATUS pgp_renew_key(
vb@201
    62
        PEP_SESSION session,
vb@201
    63
        const char *fpr,
vb@201
    64
        const timestamp *ts
vb@201
    65
    );
vb@201
    66
vb@211
    67
PEP_STATUS pgp_revoke_key(
vb@211
    68
        PEP_SESSION session,
vb@211
    69
        const char *fpr,
vb@211
    70
        const char *reason
vb@211
    71
    );
vb@24
    72
vb@214
    73
PEP_STATUS pgp_key_expired(
vb@214
    74
        PEP_SESSION session,
vb@214
    75
        const char *fpr,
Edouard@701
    76
        const time_t when,
vb@214
    77
        bool *expired
vb@214
    78
    );
vb@214
    79
Edouard@662
    80
PEP_STATUS pgp_key_revoked(
Edouard@662
    81
        PEP_SESSION session,
Edouard@662
    82
        const char *fpr,
Edouard@662
    83
        bool *revoked
Edouard@662
    84
    );
Edouard@662
    85
vb@958
    86
PEP_STATUS pgp_key_created(
vb@958
    87
        PEP_SESSION session,
vb@958
    88
        const char *fpr,
vb@958
    89
        time_t *created
vb@958
    90
    );
vb@958
    91
krista@1357
    92
PEP_STATUS pgp_contains_priv_key(
krista@1357
    93
        PEP_SESSION session, 
krista@1357
    94
        const char *fpr,
krista@1357
    95
        bool *has_private);
krista@1357
    96
krista@1357
    97
PEP_STATUS pgp_find_private_keys(
krista@1357
    98
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
krista@1357
    99
);
krista@1357
   100
vb@507
   101
PEP_STATUS pgp_binary(const char **path);
vb@507
   102
#define PGP_BINARY_PATH pgp_binary
vb@507
   103