src/message_api.h
author vb
Wed, 11 Mar 2015 12:25:19 +0100
changeset 101 d90b10cb193d
parent 99 0dd18131a6e8
child 102 f75794bc7259
permissions -rw-r--r--
more
vb@39
     1
#pragma once
vb@39
     2
vb@101
     3
#include "message.h"
vb@101
     4
#include "mime.h"
vb@101
     5
vb@37
     6
#ifdef __cplusplus
vb@37
     7
extern "C" {
vb@37
     8
#endif
vb@37
     9
vb@39
    10
vb@39
    11
// encrypt_message() - encrypt message in memory
vb@39
    12
//
vb@39
    13
//  parameters:
vb@48
    14
//      session (in)        session handle
vb@48
    15
//      src (in)            message to encrypt
vb@48
    16
//      extra (in)          extra keys for encryption
vb@83
    17
//      dst (out)           pointer to new encrypted message or NULL on failure
vb@84
    18
//      enc_format (in)     encrypted format
vb@39
    19
//
vb@39
    20
//  return value:
vb@48
    21
//      PEP_STATUS_OK                   on success
vb@48
    22
//		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
vb@48
    23
//		                                could not be found
vb@48
    24
//		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
vb@48
    25
//		                                an ambiguous name
vb@48
    26
//		PEP_GET_KEY_FAILED		        cannot retrieve key
vb@83
    27
//
vb@83
    28
//	caveat:
vb@83
    29
//	    the ownership of the new message goes to the caller
vb@38
    30
vb@44
    31
DYNAMIC_API PEP_STATUS encrypt_message(
vb@37
    32
        PEP_SESSION session,
vb@37
    33
        const message *src,
vb@37
    34
        stringlist_t *extra,
vb@38
    35
        message **dst,
vb@81
    36
        PEP_enc_format enc_format
vb@37
    37
    );
vb@37
    38
vb@39
    39
vb@39
    40
// decrypt_message() - decrypt message in memory
vb@39
    41
//
vb@39
    42
//  parameters:
vb@48
    43
//      session (in)        session handle
vb@48
    44
//      src (in)            message to decrypt
vb@83
    45
//      dst (out)           pointer to new decrypted message or NULL on failure
vb@84
    46
//      enc_format (in)     unencrypted format
vb@39
    47
//
vb@39
    48
//  return value:
vb@39
    49
//      error status or PEP_STATUS_OK on success
vb@83
    50
//
vb@83
    51
//	caveat:
vb@83
    52
//	    the ownership of the new message goes to the caller
vb@39
    53
vb@44
    54
DYNAMIC_API PEP_STATUS decrypt_message(
vb@37
    55
        PEP_SESSION session,
vb@37
    56
        const message *src,
vb@81
    57
        message **dst,
vb@81
    58
        PEP_enc_format enc_format
vb@37
    59
    );
vb@37
    60
vb@37
    61
#ifdef __cplusplus
vb@37
    62
}
vb@37
    63
#endif
vb@37
    64