src/blacklist.h
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Tue, 22 Dec 2020 17:48:03 +0100
branchRelease_2.1
changeset 5246 67016f508d40
parent 2415 7410f7666976
permissions -rw-r--r--
ENGINE-870 graft: replace #pragma once with include guards
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #ifndef BLACKLIST_H
     5 #define BLACKLIST_H
     6 
     7 #include "pEpEngine.h"
     8 
     9 #ifdef __cplusplus
    10 extern "C" {
    11 #endif
    12 
    13 // blacklist_add() - add to blacklist
    14 //
    15 //  parameters:
    16 //      session (in)        session to use
    17 //      fpr (in)            fingerprint of key to blacklist
    18 //
    19 //  caveat:
    20 //      there is no point in blacklisting an own key; for any own
    21 //      identity, this will be ignored. The correct function to use
    22 //      for own keys in this event is "key_reset_trust".
    23 //      Also, this is only effective for OpenPGP-level trust. If
    24 //      this key is for a pEp user, the blacklist is ignored.
    25 
    26 DYNAMIC_API PEP_STATUS blacklist_add(PEP_SESSION session, const char *fpr);
    27 
    28 
    29 // blacklist_delete() - delete from blacklist
    30 //
    31 //  parameters:
    32 //      session (in)        session to use
    33 //      fpr (in)            fingerprint of key to be removed from blacklist
    34 
    35 DYNAMIC_API PEP_STATUS blacklist_delete(PEP_SESSION session, const char *fpr);
    36 
    37 
    38 // blacklist_is_listed() - is_listed in blacklist
    39 //
    40 //  parameters:
    41 //      session (in)        session to use
    42 //      fpr (in)            fingerprint of key to blacklist
    43 //      bool (out)          flags if key is blacklisted
    44 
    45 DYNAMIC_API PEP_STATUS blacklist_is_listed(
    46         PEP_SESSION session,
    47         const char *fpr,
    48         bool *listed
    49     );
    50 
    51 
    52 // blacklist_retrieve() - retrieve full blacklist of key fingerprints
    53 //
    54 //  parameters:
    55 //      session (in)        session to use
    56 //      blacklist (out)     copy of blacklist
    57 //
    58 //  caveat:
    59 //      the ownership of the copy of blacklist goes to the caller
    60 
    61 DYNAMIC_API PEP_STATUS blacklist_retrieve(
    62         PEP_SESSION session,
    63         stringlist_t **blacklist
    64     );
    65 
    66 
    67 #ifdef __cplusplus
    68 }
    69 #endif
    70 
    71 #endif