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.

52 lines
1.3 KiB

3 years ago
3 years ago
3 years ago
  1. // p≡p Message API
  2. // Copyleft (c) 2019, p≡p foundation
  3. // this file is under GNU General Public License 3.0
  4. // see LICENSE.txt
  5. // written by Volker Birk
  6. protocol session {
  7. method encrypt_message
  8. doc="encrypt message in memory"
  9. {
  10. // parms
  11. supply message src
  12. doc="""
  13. message to encrypt - usually in-only, but can be in-out for
  14. unencrypted messages; in that case, we may attach the key and
  15. decorate the message
  16. """;
  17. use hash_list extra doc="extra keys for encryption";
  18. create message dst
  19. doc="""
  20. pointer to new encrypted message or #NV if no encryption could
  21. take place
  22. """
  23. use encformat format doc="encrypted format";
  24. // flags
  25. flags {
  26. flag default 0x0 doc='"default" means whatever the default behaviour for the function is.';
  27. flag force_encryption 0x1;
  28. }
  29. // exceptions
  30. throws key_has_ambig_name
  31. doc="at least one of the receipient keys has an ambiguous name";
  32. throws unencrypted
  33. doc="""
  34. on demand or no recipients with usable key, is left unencrypted,
  35. and key is attached to it
  36. """
  37. }
  38. }