src/message_api.h
author vb
Sun, 15 Mar 2015 21:07:12 +0100
changeset 117 d2ff99ccdf30
parent 113 4bee48270834
child 189 dc89296e774b
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@117
    32
//	    if src is unencrypted this function returns PEP_UNENCRYPTED and sets
vb@117
    33
//	    dst to NULL
vb@38
    34
vb@44
    35
DYNAMIC_API PEP_STATUS encrypt_message(
vb@37
    36
        PEP_SESSION session,
vb@113
    37
        message *src,
vb@37
    38
        stringlist_t *extra,
vb@38
    39
        message **dst,
vb@81
    40
        PEP_enc_format enc_format
vb@37
    41
    );
vb@37
    42
vb@39
    43
vb@39
    44
// decrypt_message() - decrypt message in memory
vb@39
    45
//
vb@39
    46
//  parameters:
vb@48
    47
//      session (in)        session handle
vb@48
    48
//      src (in)            message to decrypt
vb@113
    49
//      mime (in)           MIME encoding wanted
vb@83
    50
//      dst (out)           pointer to new decrypted message or NULL on failure
vb@39
    51
//
vb@39
    52
//  return value:
vb@39
    53
//      error status or PEP_STATUS_OK on success
vb@83
    54
//
vb@83
    55
//	caveat:
vb@83
    56
//	    the ownership of the new message goes to the caller
vb@39
    57
vb@44
    58
DYNAMIC_API PEP_STATUS decrypt_message(
vb@37
    59
        PEP_SESSION session,
vb@113
    60
        message *src,
vb@113
    61
        PEP_MIME_format mime,
vb@113
    62
        message **dst
vb@37
    63
    );
vb@37
    64
vb@37
    65
#ifdef __cplusplus
vb@37
    66
}
vb@37
    67
#endif
vb@37
    68