src/message_api.h
author vb
Tue, 03 Mar 2015 11:04:40 +0100
changeset 84 2009f3090d32
parent 83 c5d82f11689a
child 99 0dd18131a6e8
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@83
    16
//      dst (out)           pointer to new encrypted message or NULL on failure
vb@84
    17
//      enc_format (in)     encrypted 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@83
    26
//
vb@83
    27
//	caveat:
vb@83
    28
//	    the ownership of the new message goes to the caller
vb@38
    29
vb@44
    30
DYNAMIC_API PEP_STATUS encrypt_message(
vb@37
    31
        PEP_SESSION session,
vb@37
    32
        const message *src,
vb@37
    33
        stringlist_t *extra,
vb@38
    34
        message **dst,
vb@81
    35
        PEP_enc_format enc_format
vb@37
    36
    );
vb@37
    37
vb@39
    38
vb@39
    39
// decrypt_message() - decrypt message in memory
vb@39
    40
//
vb@39
    41
//  parameters:
vb@48
    42
//      session (in)        session handle
vb@48
    43
//      src (in)            message to decrypt
vb@83
    44
//      dst (out)           pointer to new decrypted message or NULL on failure
vb@84
    45
//      enc_format (in)     unencrypted format
vb@39
    46
//
vb@39
    47
//  return value:
vb@39
    48
//      error status or PEP_STATUS_OK on success
vb@83
    49
//
vb@83
    50
//	caveat:
vb@83
    51
//	    the ownership of the new message goes to the caller
vb@39
    52
vb@44
    53
DYNAMIC_API PEP_STATUS decrypt_message(
vb@37
    54
        PEP_SESSION session,
vb@37
    55
        const message *src,
vb@81
    56
        message **dst,
vb@81
    57
        PEP_enc_format enc_format
vb@37
    58
    );
vb@37
    59
vb@37
    60
#ifdef __cplusplus
vb@37
    61
}
vb@37
    62
#endif
vb@37
    63