src/pgp_gpg.h
author Krista Bennett <krista@pep-project.org>
Fri, 01 Jun 2018 10:30:19 +0200
branchENGINE-254
changeset 2723 7194b9c8599d
parent 1924 c40a363fae45
child 2429 64e8a527c7d6
permissions -rw-r--r--
close branch
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #pragma once
     5 
     6 #include "pEpEngine.h"
     7 
     8 PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
     9 void pgp_release(PEP_SESSION session, bool out_last);
    10 
    11 PEP_STATUS pgp_decrypt_and_verify(
    12         PEP_SESSION session, const char *ctext, size_t csize,
    13         const char *dsigtext, size_t dsigsize,
    14         char **ptext, size_t *psize, stringlist_t **keylist
    15     );
    16 
    17 PEP_STATUS pgp_encrypt_and_sign(
    18         PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
    19         size_t psize, char **ctext, size_t *csize
    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_import_private_keydata(PEP_SESSION session, const char *key_data,
    62                                       size_t size, identity_list **private_idents);
    63 
    64 PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
    65 PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
    66 
    67 PEP_STATUS pgp_renew_key(
    68         PEP_SESSION session,
    69         const char *fpr,
    70         const timestamp *ts
    71     );
    72 
    73 PEP_STATUS pgp_revoke_key(
    74         PEP_SESSION session,
    75         const char *fpr,
    76         const char *reason
    77     );
    78 
    79 PEP_STATUS pgp_key_expired(
    80         PEP_SESSION session,
    81         const char *fpr,
    82         const time_t when,
    83         bool *expired
    84     );
    85 
    86 PEP_STATUS pgp_key_revoked(
    87         PEP_SESSION session,
    88         const char *fpr,
    89         bool *revoked
    90     );
    91 
    92 PEP_STATUS pgp_key_created(
    93         PEP_SESSION session,
    94         const char *fpr,
    95         time_t *created
    96     );
    97 
    98 PEP_STATUS pgp_contains_priv_key(
    99         PEP_SESSION session, 
   100         const char *fpr,
   101         bool *has_private);
   102 
   103 PEP_STATUS pgp_find_private_keys(
   104     PEP_SESSION session, const char *pattern, stringlist_t **keylist
   105 );
   106 
   107 PEP_STATUS pgp_binary(const char **path);
   108 
   109 /* Really only internal. */
   110 PEP_STATUS pgp_replace_only_uid(
   111         PEP_SESSION session,
   112         const char* fpr,
   113         const char* realname,
   114         const char* email
   115     );
   116 
   117 
   118 #define PGP_BINARY_PATH pgp_binary