src/message_api.h
author vb
Sun, 08 Feb 2015 11:33:04 -0500
changeset 48 9ff5d2dfa75a
parent 44 4013b57a6a69
child 81 044ce1c7fc9c
permissions -rw-r--r--
...
vb@39
     1
#pragma once
vb@39
     2
vb@37
     3
#ifdef __cplusplus
vb@37
     4
extern "C" {
vb@37
     5
#endif
vb@37
     6
vb@37
     7
#include "transport.h"
vb@37
     8
vb@39
     9
vb@39
    10
// encrypt_message() - encrypt message in memory
vb@39
    11
//
vb@39
    12
//  parameters:
vb@48
    13
//      session (in)        session handle
vb@48
    14
//      src (in)            message to encrypt
vb@48
    15
//      extra (in)          extra keys for encryption
vb@48
    16
//      dst (out)           pointer to encrypted message or NULL on failure
vb@48
    17
//      format (in)         encryption format
vb@39
    18
//
vb@39
    19
//  return value:
vb@48
    20
//      PEP_STATUS_OK                   on success
vb@48
    21
//		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
vb@48
    22
//		                                could not be found
vb@48
    23
//		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
vb@48
    24
//		                                an ambiguous name
vb@48
    25
//		PEP_GET_KEY_FAILED		        cannot retrieve key
vb@38
    26
vb@44
    27
DYNAMIC_API PEP_STATUS encrypt_message(
vb@37
    28
        PEP_SESSION session,
vb@37
    29
        const message *src,
vb@37
    30
        stringlist_t *extra,
vb@38
    31
        message **dst,
vb@38
    32
        PEP_enc_format format
vb@37
    33
    );
vb@37
    34
vb@39
    35
vb@39
    36
// decrypt_message() - decrypt message in memory
vb@39
    37
//
vb@39
    38
//  parameters:
vb@48
    39
//      session (in)        session handle
vb@48
    40
//      src (in)            message to decrypt
vb@48
    41
//      dst (out)           pointer to decrypted message or NULL on failure
vb@39
    42
//
vb@39
    43
//  return value:
vb@39
    44
//      error status or PEP_STATUS_OK on success
vb@39
    45
vb@44
    46
DYNAMIC_API PEP_STATUS decrypt_message(
vb@37
    47
        PEP_SESSION session,
vb@37
    48
        const message *src,
vb@37
    49
        message **dst
vb@37
    50
    );
vb@37
    51
vb@37
    52
#ifdef __cplusplus
vb@37
    53
}
vb@37
    54
#endif
vb@37
    55