src/pgp_gpg.h
author Krista Grothoff <krista@pep-project.org>
Tue, 08 Nov 2016 00:12:17 +0100
branchENGINE-84
changeset 1357 b1677cd84729
parent 1103 aba4f9ea5bce
child 1397 0a64816a6e37
permissions -rw-r--r--
ENGINE-84: working on ensuring keypairs missing private keys are not selected for encryption candidates
vb@24
     1
#pragma once
vb@24
     2
vb@24
     3
#include "pEpEngine.h"
vb@24
     4
vb@62
     5
PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
vb@62
     6
void pgp_release(PEP_SESSION session, bool out_last);
vb@24
     7
vb@24
     8
PEP_STATUS pgp_decrypt_and_verify(
vb@49
     9
        PEP_SESSION session, const char *ctext, size_t csize,
vb@49
    10
        char **ptext, size_t *psize, stringlist_t **keylist
vb@24
    11
    );
vb@24
    12
vb@24
    13
PEP_STATUS pgp_encrypt_and_sign(
vb@49
    14
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
vb@49
    15
        size_t psize, char **ctext, size_t *csize
vb@24
    16
    );
vb@24
    17
vb@24
    18
PEP_STATUS pgp_verify_text(
vb@49
    19
        PEP_SESSION session, const char *text, size_t size,
vb@49
    20
        const char *signature, size_t sig_size, stringlist_t **keylist
vb@24
    21
    );
vb@24
    22
vb@24
    23
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
vb@24
    24
Edouard@170
    25
PEP_STATUS pgp_export_keydata(
vb@1103
    26
        PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
vb@1103
    27
        bool secret
vb@24
    28
    );
vb@24
    29
vb@24
    30
PEP_STATUS pgp_find_keys(
vb@49
    31
        PEP_SESSION session, const char *pattern, stringlist_t **keylist
vb@24
    32
    );
vb@24
    33
krista@1030
    34
PEP_STATUS pgp_list_keyinfo(
krista@1030
    35
    PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
krista@1030
    36
    );
krista@1030
    37
vb@24
    38
PEP_STATUS pgp_generate_keypair(
vb@49
    39
        PEP_SESSION session, pEp_identity *identity
vb@24
    40
    );
vb@24
    41
vb@24
    42
PEP_STATUS pgp_get_key_rating(
vb@74
    43
        PEP_SESSION session,
vb@74
    44
        const char *fpr,
vb@74
    45
        PEP_comm_type *comm_type
vb@24
    46
    );
vb@24
    47
Edouard@170
    48
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
Edouard@728
    49
                              size_t size, identity_list **private_idents);
Edouard@728
    50
Edouard@728
    51
PEP_STATUS pgp_import_private_keydata(PEP_SESSION session, const char *key_data,
Edouard@728
    52
                                      size_t size, identity_list **private_idents);
vb@24
    53
vb@24
    54
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
vb@200
    55
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
vb@201
    56
vb@201
    57
PEP_STATUS pgp_renew_key(
vb@201
    58
        PEP_SESSION session,
vb@201
    59
        const char *fpr,
vb@201
    60
        const timestamp *ts
vb@201
    61
    );
vb@201
    62
vb@211
    63
PEP_STATUS pgp_revoke_key(
vb@211
    64
        PEP_SESSION session,
vb@211
    65
        const char *fpr,
vb@211
    66
        const char *reason
vb@211
    67
    );
vb@24
    68
vb@214
    69
PEP_STATUS pgp_key_expired(
vb@214
    70
        PEP_SESSION session,
vb@214
    71
        const char *fpr,
Edouard@701
    72
        const time_t when,
vb@214
    73
        bool *expired
vb@214
    74
    );
vb@214
    75
Edouard@662
    76
PEP_STATUS pgp_key_revoked(
Edouard@662
    77
        PEP_SESSION session,
Edouard@662
    78
        const char *fpr,
Edouard@662
    79
        bool *revoked
Edouard@662
    80
    );
Edouard@662
    81
vb@958
    82
PEP_STATUS pgp_key_created(
vb@958
    83
        PEP_SESSION session,
vb@958
    84
        const char *fpr,
vb@958
    85
        time_t *created
vb@958
    86
    );
vb@958
    87
krista@1357
    88
PEP_STATUS pgp_contains_priv_key(
krista@1357
    89
        PEP_SESSION session, 
krista@1357
    90
        const char *fpr,
krista@1357
    91
        bool *has_private);
krista@1357
    92
krista@1357
    93
PEP_STATUS pgp_find_private_keys(
krista@1357
    94
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
krista@1357
    95
);
krista@1357
    96
vb@507
    97
PEP_STATUS pgp_binary(const char **path);
vb@507
    98
#define PGP_BINARY_PATH pgp_binary
vb@507
    99