src/openpgp_compat.h
author Krista Grothoff <krista@pep-project.org>
Thu, 18 Aug 2016 13:23:15 +0200
branchENGINE-73
changeset 1030 4354451338cd
child 1032 b4004d33c2a2
permissions -rw-r--r--
ENGINE-73 added openpgp compat files for listing keyinfo #comment Redesign: function is now OpenPGP_list_keyinfo() in openpgp_compat.c/.h, returns full pgp key fingerprint + primary gpg uid string (Real Name <email@address.blah>)
krista@1030
     1
// openpgp_compat.h
krista@1030
     2
//
krista@1030
     3
// These functions are the exposure of non-generic PGP-specific functionality (largely related to PGP
krista@1030
     4
// keyrings) to adapters that need them without polluting the engine interface.
krista@1030
     5
//
krista@1030
     6
#pragma once
krista@1030
     7
krista@1030
     8
#ifdef __cplusplus
krista@1030
     9
extern "C" {
krista@1030
    10
#endif
krista@1030
    11
krista@1030
    12
#include <stddef.h>
krista@1030
    13
#include <stdint.h>
krista@1030
    14
#include <stdbool.h>
krista@1030
    15
    
krista@1030
    16
#include "dynamic_api.h"
krista@1030
    17
#include "stringpair.h"    
krista@1030
    18
krista@1030
    19
#ifdef USE_GPG
krista@1030
    20
#include "pgp_gpg.h"
krista@1030
    21
#else
krista@1030
    22
#ifdef USE_NETPGP
krista@1030
    23
#include "pgp_netpgp.h"
krista@1030
    24
#endif
krista@1030
    25
#endif    
krista@1030
    26
    
krista@1030
    27
//  OpenPGP_list_keyinfo() - get a key/UID list for pattern matches in keyring (NULL
krista@1030
    28
//                           to return entire keyring)
krista@1030
    29
//
krista@1030
    30
//  parameters:
krista@1030
    31
//      session (in)          session handle
krista@1030
    32
//      show_revoked (in)     true if identities with revoked primary keys should also
krista@1030
    33
//                            be listed; false if only valid keys should be shown
krista@1030
    34
//      keyinfo_list (out)    list of identities for each available key 
krista@1030
    35
//
krista@1030
    36
//  caveat: FIXME
krista@1030
    37
//        the ownership of the identity list goes to the caller
krista@1030
    38
//        the caller must use free_identity_list() to free it
krista@1030
    39
//        identity objects derived from the keyring only have the available information
krista@1030
    40
//           from the keyring; some fields may be NULL
krista@1030
    41
DYNAMIC_API PEP_STATUS OpenPGP_list_keyinfo (
krista@1030
    42
        PEP_SESSION session, stringpair_list_t** keyinfo_list, char* search_pattern
krista@1030
    43
    );
krista@1030
    44
    
krista@1030
    45
#ifdef __cplusplus
krista@1030
    46
}
krista@1030
    47
#endif