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.

104 lines
3.7 KiB

  1. -- This file is under BSD License 2.0
  2. --
  3. -- Sync protocol for p≡p
  4. -- Copyright (c) 2021 p≡p foundation
  5. --
  6. -- Written by Hartmut Goebel
  7. PEP-MESSAGE {
  8. iso(1) org(3) dod(6) internet(1) private(4)
  9. enterprise(1) pEp(47878) message(1)
  10. }
  11. DEFINITIONS
  12. AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
  13. BEGIN
  14. EXPORTS ASN1Message;
  15. IMPORTS
  16. PString, PStringList, PStringPairList, Hash, ISO639-1
  17. FROM PEP { iso(1) org(3) dod(6) internet(1) private(4)
  18. enterprise(1) pEp(47878) basic(0) };
  19. MessageDirection ::= ENUMERATED {
  20. incoming (0),
  21. outgoing (1)
  22. }
  23. ContentDisposition ::= ENUMERATED {
  24. attachment (0),
  25. inline (1),
  26. other (2)
  27. }
  28. PBlob ::= SEQUENCE {
  29. value OCTET STRING (SIZE(0..102400000)), -- up to 100 MB
  30. mime-type PString OPTIONAL,
  31. filename PString OPTIONAL,
  32. disposition ContentDisposition
  33. }
  34. PBlobList ::= SEQUENCE OF PBlob
  35. -- For the purposes of this profile, GeneralizedTime values MUST be
  36. -- expressed in Coordinated Universal Time (UTC) and MUST include seconds
  37. -- (i.e., times are YYYYMMDDHHMMSSZ), even where the number of seconds
  38. -- is zero. GeneralizedTime values MUST NOT include fractional seconds.
  39. PIdentity ::= SEQUENCE {
  40. address PString,
  41. fpr Hash OPTIONAL,
  42. user-id PString,
  43. username PString OPTIONAL,
  44. comm-type INTEGER (0..255),
  45. lang ISO639-1 OPTIONAL
  46. }
  47. PIdentityList ::= SEQUENCE OF PIdentity
  48. ASN1Message ::= SEQUENCE {
  49. direction MessageDirection OPTIONAL, -- used only in "inner" messages
  50. id PString OPTIONAL, -- UTF-8 string of message ID
  51. sent GeneralizedTime OPTIONAL, -- when the message is sent
  52. recv GeneralizedTime OPTIONAL, -- when the message is received
  53. from PIdentity, -- whom the message is from
  54. -- At least one of to, cc must not be an empty list
  55. -- FIXME: Can this be constrained?
  56. to PIdentityList OPTIONAL, -- whom the message is to
  57. cc PIdentityList OPTIONAL, -- whom a CC is being sent
  58. bcc PIdentityList OPTIONAL, -- whom a BCC is being sent
  59. recv-by PIdentity OPTIONAL, -- via which identity the message
  60. -- is received
  61. reply-to PIdentityList OPTIONAL, -- where a reply should go to
  62. in-reply-to PStringList OPTIONAL, -- list of UTF-8 strings with
  63. -- MessageIDs of refering messages
  64. -- internal: refering_msg_ref
  65. references PStringList OPTIONAL, -- list of UTF-8 strings with
  66. -- references
  67. -- internal: refered_by _message-ref-list
  68. keywords PStringList OPTIONAL, -- list of UTF-8 strings with keywords
  69. comments PString OPTIONAL, -- UTF-8 string with comments
  70. opt-fields PStringPairList OPTIONAL, -- optional fields
  71. sender-fpr Hash OPTIONAL, -- fingerprint of sending signer
  72. -- At least one of shortmsg, longmsg, longmsg-formatted must be present
  73. -- FIXME: Can this be constrained?
  74. shortmsg PString OPTIONAL, -- UTF-8 string of short message
  75. -- longmsg must only be used if implementation can handle dynamic allocation
  76. longmsg UTF8String OPTIONAL, -- UTF-8 string of long message
  77. -- (plain)
  78. -- longmsg-formatted must only be used if implementation can handle
  79. -- dynamic allocation
  80. longmsg-formatted UTF8String OPTIONAL, -- UTF-8 string of long message
  81. -- (formatted)
  82. attachments PBlobList OPTIONAL -- blobs with attachments
  83. -- internal: rawmsg
  84. }
  85. END