src/pgp_sequoia.h
author Dirk Zimmermann <dz@pep.security>
Thu, 11 Apr 2019 10:46:46 +0200
branchIOS-1482
changeset 3505 3fe4b41696d3
parent 3191 53dcb2892c3f
child 3689 6ea4a0524c38
permissions -rw-r--r--
IOS-1482 close branch
neal@3191
     1
// This file is under GNU General Public License 3.0
neal@3191
     2
// see LICENSE.txt
neal@3191
     3
neal@3191
     4
#pragma once
neal@3191
     5
neal@3191
     6
#include "pEpEngine.h"
neal@3191
     7
neal@3191
     8
PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
neal@3191
     9
void pgp_release(PEP_SESSION session, bool out_last);
neal@3191
    10
neal@3191
    11
PEP_STATUS pgp_decrypt_and_verify(
neal@3191
    12
        PEP_SESSION session, const char *ctext, size_t csize,
neal@3191
    13
        const char *dsigtext, size_t dsigsize,
neal@3191
    14
        char **ptext, size_t *psize, stringlist_t **keylist,
neal@3191
    15
        char** filename_ptr
neal@3191
    16
    );
neal@3191
    17
neal@3191
    18
PEP_STATUS pgp_encrypt_and_sign(
neal@3191
    19
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
neal@3191
    20
        size_t psize, char **ctext, size_t *csize
neal@3191
    21
    );
neal@3191
    22
neal@3191
    23
PEP_STATUS pgp_sign_only(
neal@3191
    24
        PEP_SESSION session, const char* fpr, const char *ptext,
neal@3191
    25
        size_t psize, char **stext, size_t *ssize
neal@3191
    26
    );
neal@3191
    27
neal@3191
    28
PEP_STATUS pgp_encrypt_only(
neal@3191
    29
        PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
neal@3191
    30
        size_t psize, char **ctext, size_t *csize
neal@3191
    31
    );
neal@3191
    32
neal@3191
    33
neal@3191
    34
PEP_STATUS pgp_verify_text(
neal@3191
    35
        PEP_SESSION session, const char *text, size_t size,
neal@3191
    36
        const char *signature, size_t sig_size, stringlist_t **keylist
neal@3191
    37
    );
neal@3191
    38
neal@3191
    39
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
neal@3191
    40
neal@3191
    41
PEP_STATUS pgp_export_keydata(
neal@3191
    42
        PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
neal@3191
    43
        bool secret
neal@3191
    44
    );
neal@3191
    45
neal@3191
    46
PEP_STATUS pgp_find_keys(
neal@3191
    47
        PEP_SESSION session, const char *pattern, stringlist_t **keylist
neal@3191
    48
    );
neal@3191
    49
neal@3191
    50
PEP_STATUS pgp_list_keyinfo(
neal@3191
    51
        PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
neal@3191
    52
    );
neal@3191
    53
neal@3191
    54
PEP_STATUS pgp_generate_keypair(
neal@3191
    55
        PEP_SESSION session, pEp_identity *identity
neal@3191
    56
    );
neal@3191
    57
neal@3191
    58
PEP_STATUS pgp_get_key_rating(
neal@3191
    59
        PEP_SESSION session,
neal@3191
    60
        const char *fpr,
neal@3191
    61
        PEP_comm_type *comm_type
neal@3191
    62
    );
neal@3191
    63
neal@3191
    64
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
neal@3191
    65
                              size_t size, identity_list **private_idents);
neal@3191
    66
neal@3191
    67
PEP_STATUS pgp_import_private_keydata(PEP_SESSION session, const char *key_data,
neal@3191
    68
                                      size_t size, identity_list **private_idents);
neal@3191
    69
neal@3191
    70
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
neal@3191
    71
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
neal@3191
    72
neal@3191
    73
PEP_STATUS pgp_renew_key(
neal@3191
    74
        PEP_SESSION session,
neal@3191
    75
        const char *fpr,
neal@3191
    76
        const timestamp *ts
neal@3191
    77
    );
neal@3191
    78
neal@3191
    79
PEP_STATUS pgp_revoke_key(
neal@3191
    80
        PEP_SESSION session,
neal@3191
    81
        const char *fpr,
neal@3191
    82
        const char *reason
neal@3191
    83
    );
neal@3191
    84
neal@3191
    85
PEP_STATUS pgp_key_expired(
neal@3191
    86
        PEP_SESSION session,
neal@3191
    87
        const char *fpr,
neal@3191
    88
        const time_t when,
neal@3191
    89
        bool *expired
neal@3191
    90
    );
neal@3191
    91
neal@3191
    92
PEP_STATUS pgp_key_revoked(
neal@3191
    93
        PEP_SESSION session,
neal@3191
    94
        const char *fpr,
neal@3191
    95
        bool *revoked
neal@3191
    96
    );
neal@3191
    97
neal@3191
    98
PEP_STATUS pgp_key_created(
neal@3191
    99
        PEP_SESSION session,
neal@3191
   100
        const char *fpr,
neal@3191
   101
        time_t *created
neal@3191
   102
    );
neal@3191
   103
neal@3191
   104
PEP_STATUS pgp_contains_priv_key(
neal@3191
   105
        PEP_SESSION session, 
neal@3191
   106
        const char *fpr,
neal@3191
   107
        bool *has_private);
neal@3191
   108
neal@3191
   109
PEP_STATUS pgp_find_private_keys(
neal@3191
   110
    PEP_SESSION session, const char *pattern, stringlist_t **keylist
neal@3191
   111
);
neal@3191
   112
neal@3191
   113
PEP_STATUS pgp_binary(const char **path);
neal@3191
   114
neal@3191
   115
#define PGP_BINARY_PATH pgp_binary