src/pgp_netpgp.h
author Krista Bennett <krista@pep-project.org>
Fri, 01 Jun 2018 10:30:19 +0200
branchENGINE-254
changeset 2723 7194b9c8599d
parent 1677 e02c53c94550
child 1687 e376c005ff2d
child 2458 2dfe65bd3613
permissions -rw-r--r--
close branch
     1 // This file is under GNU General Public License 3.0
     2 
     3 #pragma once
     4 
     5 #include "pEpEngine.h"
     6 
     7 PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
     8 void pgp_release(PEP_SESSION session, bool out_last);
     9 
    10 PEP_STATUS pgp_decrypt_and_verify(
    11         PEP_SESSION session, const char *ctext, size_t csize,
    12         const char *dsigtext, size_t dsigsize,
    13         char **ptext, size_t *psize, stringlist_t **keylist
    14     );
    15 
    16 PEP_STATUS pgp_encrypt_and_sign(
    17         PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
    18         size_t psize, char **ctext, size_t *csize
    19     );
    20 
    21 
    22 PEP_STATUS pgp_encrypt_only(
    23         PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
    24         size_t psize, char **ctext, size_t *csize
    25     );
    26 
    27 
    28 PEP_STATUS pgp_verify_text(
    29         PEP_SESSION session, const char *text, size_t size,
    30         const char *signature, size_t sig_size, stringlist_t **keylist
    31     );
    32 
    33 PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
    34 
    35 PEP_STATUS pgp_export_keydata(
    36         PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
    37         bool secret
    38     );
    39 
    40 PEP_STATUS pgp_find_keys(
    41         PEP_SESSION session, const char *pattern, stringlist_t **keylist
    42     );
    43 
    44 PEP_STATUS pgp_list_keyinfo(
    45     PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
    46     );
    47 
    48 PEP_STATUS pgp_generate_keypair(
    49         PEP_SESSION session, pEp_identity *identity
    50     );
    51 
    52 PEP_STATUS pgp_get_key_rating(
    53         PEP_SESSION session,
    54         const char *fpr,
    55         PEP_comm_type *comm_type
    56     );
    57 
    58 PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
    59         size_t size, identity_list **private_idents);
    60 
    61 PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
    62 PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
    63 
    64 PEP_STATUS pgp_renew_key(
    65         PEP_SESSION session,
    66         const char *fpr,
    67         const timestamp *ts
    68     );
    69 
    70 PEP_STATUS pgp_revoke_key(
    71         PEP_SESSION session,
    72         const char *fpr,
    73         const char *reason
    74     );
    75 
    76 PEP_STATUS pgp_key_expired(
    77         PEP_SESSION session,
    78         const char *fpr,
    79         const time_t when,
    80         bool *expired
    81     );
    82 
    83 PEP_STATUS pgp_key_revoked(
    84         PEP_SESSION session,
    85         const char *fpr,
    86         bool *revoked
    87     );
    88 
    89 PEP_STATUS pgp_key_created(
    90         PEP_SESSION session,
    91         const char *fprstr,
    92         time_t *created
    93     );
    94 
    95 PEP_STATUS pgp_contains_priv_key(
    96     PEP_SESSION session,
    97     const char *fpr,
    98     bool *has_private);
    99 
   100 PEP_STATUS pgp_find_private_keys(
   101     PEP_SESSION session, const char *pattern, stringlist_t **keylist
   102 );