src/message_api.h
changeset 39 66b5cc6cb987
parent 38 271bea5552dc
child 44 4013b57a6a69
     1.1 --- a/src/message_api.h	Mon Dec 29 20:48:30 2014 +0100
     1.2 +++ b/src/message_api.h	Tue Dec 30 13:04:17 2014 +0100
     1.3 @@ -1,14 +1,25 @@
     1.4 +#pragma once
     1.5 +
     1.6  #ifdef __cplusplus
     1.7  extern "C" {
     1.8  #endif
     1.9  
    1.10  #include "transport.h"
    1.11  
    1.12 -typedef enum _PEP_enc_format {
    1.13 -    PEP_enc_none = 0,
    1.14 -    PEP_enc_MIME_multipart,
    1.15 -    PEP_enc_pieces
    1.16 -} PEP_enc_format;
    1.17 +
    1.18 +// encrypt_message() - encrypt message in memory
    1.19 +//
    1.20 +//  parameters:
    1.21 +//      session             session handle
    1.22 +//      src                 message to encrypt
    1.23 +//      extra               extra keys for encryption
    1.24 +//      dst                 pointer to encrypted message or NULL on failure
    1.25 +//      format              encryption format
    1.26 +//
    1.27 +//  return value:
    1.28 +//      error status or PEP_STATUS_OK on success; PEP_KEY_NOT_FOUND if one
    1.29 +//      or more keys couldn't be found, but the message could be encrypted
    1.30 +//      with other keys
    1.31  
    1.32  PEP_STATUS encrypt_message(
    1.33          PEP_SESSION session,
    1.34 @@ -18,6 +29,17 @@
    1.35          PEP_enc_format format
    1.36      );
    1.37  
    1.38 +
    1.39 +// decrypt_message() - decrypt message in memory
    1.40 +//
    1.41 +//  parameters:
    1.42 +//      session             session handle
    1.43 +//      src                 message to decrypt
    1.44 +//      dst                 pointer to decrypted message or NULL on failure
    1.45 +//
    1.46 +//  return value:
    1.47 +//      error status or PEP_STATUS_OK on success
    1.48 +
    1.49  PEP_STATUS decrypt_message(
    1.50          PEP_SESSION session,
    1.51          const message *src,