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