src/pgp_netpgp.h
author buff <andreas@pep-project.org>
Mon, 17 Feb 2020 11:21:30 +0100
branchsync
changeset 4423 a9d0247b79ff
parent 3719 6806be48b327
child 4079 da3b0627a59c
permissions -rw-r--r--
Xcode: add newly generated files, updates generation trigger file list
     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         char** filename_ptr // will be ignored
    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 
    23 PEP_STATUS pgp_encrypt_only(
    24         PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
    25         size_t psize, char **ctext, size_t *csize
    26     );
    27 
    28 PEP_STATUS pgp_sign_only(
    29         PEP_SESSION session, const char* fpr, const char *ptext,
    30         size_t psize, char **stext, size_t *ssize
    31     );
    32 
    33 PEP_STATUS pgp_verify_text(
    34         PEP_SESSION session, const char *text, size_t size,
    35         const char *signature, size_t sig_size, stringlist_t **keylist
    36     );
    37 
    38 PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
    39 
    40 PEP_STATUS pgp_export_keydata(
    41         PEP_SESSION session, const char *fpr, char **key_data, size_t *size,
    42         bool secret
    43     );
    44 
    45 PEP_STATUS pgp_find_keys(
    46         PEP_SESSION session, const char *pattern, stringlist_t **keylist
    47     );
    48 
    49 PEP_STATUS pgp_list_keyinfo(
    50     PEP_SESSION session, const char* pattern, stringpair_list_t** keyinfo_list
    51     );
    52 
    53 PEP_STATUS pgp_generate_keypair(
    54         PEP_SESSION session, pEp_identity *identity
    55     );
    56 
    57 PEP_STATUS pgp_get_key_rating(
    58         PEP_SESSION session,
    59         const char *fpr,
    60         PEP_comm_type *comm_type
    61     );
    62 
    63 PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
    64         size_t size, identity_list **private_idents);
    65 
    66 PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
    67 PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
    68 
    69 PEP_STATUS pgp_renew_key(
    70         PEP_SESSION session,
    71         const char *fpr,
    72         const timestamp *ts
    73     );
    74 
    75 PEP_STATUS pgp_revoke_key(
    76         PEP_SESSION session,
    77         const char *fpr,
    78         const char *reason
    79     );
    80 
    81 PEP_STATUS pgp_key_expired(
    82         PEP_SESSION session,
    83         const char *fpr,
    84         const time_t when,
    85         bool *expired
    86     );
    87 
    88 PEP_STATUS pgp_key_revoked(
    89         PEP_SESSION session,
    90         const char *fpr,
    91         bool *revoked
    92     );
    93 
    94 PEP_STATUS pgp_key_created(
    95         PEP_SESSION session,
    96         const char *fprstr,
    97         time_t *created
    98     );
    99 
   100 PEP_STATUS pgp_contains_priv_key(
   101     PEP_SESSION session,
   102     const char *fpr,
   103     bool *has_private);
   104 
   105 PEP_STATUS pgp_find_private_keys(
   106     PEP_SESSION session, const char *pattern, stringlist_t **keylist
   107 );
   108 
   109 // Stub - just returns PEP_STATUS_OK, as netpgp isn't sufficient to do this.
   110 PEP_STATUS pgp_import_ultimately_trusted_keypairs(PEP_SESSION session);
   111 
   112 PEP_STATUS pgp_config_cipher_suite(PEP_SESSION session, PEP_CIPHER_SUITE suite) {
   113     if (suite == PEP_CIPHER_SUITE_DEFAULT) {
   114         return PEP_STATUS_OK;
   115     } else {
   116         return PEP_CANNOT_CONFIG;
   117     }
   118 }