p≡p engine fork for my own dirty testing of stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
2.0 KiB

  1. /**
  2. * <!-- encrypt_message() -->
  3. *
  4. * @brief Encrypt message in memory
  5. *
  6. * @param[in] session session handle
  7. * @param[in,out] src message to encrypt - usually in-only, but can be
  8. * in-out for unencrypted messages; in that case,
  9. * we may attach the key and decorate the message
  10. * @param[in] extra extra keys for encryption
  11. * @param[out] dst pointer to new encrypted message or NULL if no
  12. * encryption could take place
  13. * @param[in] enc_format The desired format this message should be encrypted with
  14. * @param[in] flags flags to set special encryption features
  15. *
  16. * @retval PEP_STATUS_OK on success
  17. * @retval PEP_KEY_HAS_AMBIG_NAME at least one of the receipient keys has
  18. * an ambiguous name
  19. * @retval PEP_UNENCRYPTED on demand or no recipients with usable
  20. * key, is left unencrypted, and key is
  21. * attached to it
  22. * @retval PEP_ILLEGAL_VALUE illegal parameter values
  23. * @retval PEP_OUT_OF_MEMORY out of memory
  24. * @retval any other value on error
  25. *
  26. * @warning the ownership of src remains with the caller
  27. * the ownership of dst goes to the caller
  28. *
  29. * enc_format PEP_enc_inline_EA:
  30. * internal format of the encrypted attachments is changing, see
  31. * https://dev.pep.foundation/Engine/ElevatedAttachments
  32. *
  33. * Only use this for transports without support for attachments
  34. * when attached data must be sent inline
  35. *
  36. */
  37. DYNAMIC_API PEP_STATUS encrypt_message(
  38. PEP_SESSION session,
  39. message *src,
  40. stringlist_t *extra,
  41. message **dst,
  42. PEP_enc_format enc_format,
  43. PEP_encrypt_flags_t flags
  44. );