Regenerate certificates with longer expiration time
[libisds.git] / doc / message
blobdfc7c513405dcdae5fc057a70847524c6b26a141
1 Message specification
2 =====================
4 Source: Provozní řád ISDS, version 2011-11-29, Page 5, 14
5 Source: Webové služby rozhranní ISDS pro manipulaci s datovými zprávami,
6     version 2.40 (2014-08-25)
7 Source: MIME Media Types
8     <http://www.iana.org/assignments/media-types/index.html>
9 Source: O2. Datové schránky: Informace pro dodavatele aplikací, version
10     2010-04-28, Page 18
11 Source: Vyhláška 194/2009 Sb., o stanovení podrobností užívání a provozování
12     informačního systému datových schránek, updated by 422/2010 Coll.
14 Message ::= Envelope, Content
16 Message format is defined in Appendix 1, file dmBaseTypes.xsd.
18 Content ::= (Document)+
20 Content involves one or more attachments (= Documents). Allowed Document
21 formats are defined in Vyhláška o stanovení podrobností užívání a provozování
22 ISDS, 194/2009 Coll.
24 Currently (2011-02-21) allowed formats are (quotation follows):
26     – pdf (Portable Document Format)
27     – PDF/A (Portable Document Format for the Long-term Archiving)
28     – xml (Extensible Markup Language Document); must be valid against
29     freely available XML Schema published by recipient
30     – fo, zfo (602XML Filler Document)
31     – html/htm (Hypertext Markup Language Document)
32     – odt (Open Document Text)
33     – ods (Open Document Spreadsheet)
34     – odp (Open Document Presentation)
35     – txt (plain text)
36     – rtf (Rich Text Format)
37     – doc, docx (MS Word Document)
38     – xls, xlsx (MS Excel Spreadsheet)
39     – ppt, pptx (MS PowerPoint Presentation)
40     – jpg, jpeg, jfif (Joint Photographic Experts Group File Interchange
41     Format)
42     – png (Portable Network Graphics)
43     – tif, tiff (Tagged Image File Format)
44     – gif (Graphics Interchange Format)
45     – mpeg1, mpeg2 (Moving Picture Experts Group Phase 1 / Phase 2)
46     – wav (Waveform Audio Format)
47     – mp2, mp3 (MPEG-1 Audio Layer 2 / Layer 3)
48     – isdoc, isdocx (Information System Document) version 5.2 or higher
49     - edi (international standard EDIFACT, standards for electotronic
50     interchange of business documents [EDI] ODETTE and EANCOM)
51     - dwg (AutoCAD DraWinG File Format) version 2007 or higher
52     - shp, dbf, shx, prj, qix, sbn, sbx (ESRI Shapefile)
53     - dgn (Bentley MicroStation Format) version V7 or V8
54     - gml, gfs, xsd (Geography Markup Language Document)
56 Document format declaration inside Document and conformance checks change
57 during time. XML Schemas provide attribute for Document MIME type and Document
58 annotation.
60 Attribute dmMimeType must present, but may be empty, may contain file name
61 extension, or may contain official MIME type. If MIME type is declared, ISDS
62 checks Document content for conformance to the MIME type.
64 There is MIME type blacklist: application/x-zip-compressed,
65 application/x-msdownload.
67 Attribute dmFileDescr (so called annotation) must present and must contain
68 file name of the Document. Even if dmMimeType exists, ISDS uses THIS attribute
69 to detect Document format (according file name extension) and checks content
70 for format conformance.
72 List of allowed MIME types is copied (and sometimes agumented) in appendix
73 of Webové služby rozhranní ISDS pro manipulaci s datovými zprávami.
75 There is list of allowed file name extensions and MIME type mapping
76 (types ordered in decreasing prefference):
78 Extensions  MIME type               Description
79 -------------------------------------------------------------------------------
80 cer, crt, der
81             application/x-x509-ca-cert  X.509 Certificate (different serialization)
82 doc         application/msword          Microsoft Word Document
83 docx        application/vnd.openxmlformats-officedocument.wordprocessingml.document
84                                         Microsoft OpenXML Document
85 dbf, prj, qix, sbn, sbx, shp, shx
86             application/octet-stream    ESRI Shapefile
87 dgn         application/octet-stream    Bentley Microstation Format
88 dwg         image/vnd.dwg               AutoCAD Drawing
89 edi         application/edifact         EDIFACT (ODETTE, EANCOM standards for
90             application/edi-x12         inernational bussines document
91             application/edi-consent     exchange)
92             text/plain
93             text/xml
94             application/xml
95 fo          application/vnd.software602.filler.form+xml
96             application/xml
97                                         602XML form (uncompressed)
98 gfs, gml    application/xml             Geography Markup Language Document
99             text/xml
100 gif         image/gif                   Graphics Interchange Format
101 html, htm   text/html                   Hyper Text MarkUp Language
102 isdoc       text/isdoc                  Information System Document
103                                         (version >= 5.2)
104 isdocx      text/isdocx                 Information System Document
105                                         (version >= 5.2)
106 jfif, jpeg, jpg
107             image/jpeg                  JFIF/JPEG image
108             image/pjpeg
109 mpeg, mpeg1, mpeg2, mpg
110             video/mpeg                  Motion Joint Picture Expert Group
111             video/mpeg1
112             video/mpeg2
113             video/mpg
114 mp2, mp3    audio/mpeg                  MPEG-1 Audio Layer II
115 odp         application/vnd.oasis.opendocument.presentation
116                                         Open Document Format Presentation
117 ods         application/vnd.oasis.opendocument.spreadsheet
118                                         Open Document Format Spreadsheet
119 odt         application/vnd.oasis.opendocument.text
120                                         Open Document Format Text
121 pdf         application/pdf             Portable Document Format
122 p7b         application/pkcs7-certificates
123             application/pkcs7-mime      
124             application/x-pkcs7-certificates
125                                         Crypto Message Syntax
126 p7c, p7m    application/pkcs7-mime      Crypto Message Syntax
127             application/x-pkcs7-mime
128 p7f         application/pkcs7-signature
129                                         Crypto Message Syntax
130 p7s         application/pkcs7-signature      
131             application/x-pkcs7-signature      
132                                         Crypto Message Syntax
133 pk7         application/pkcs7-mime      Crypto Message Syntax signatures
134             application/x-pkcs7-mime
135 png         image/png                   Portable Network Graphics
136             image/x-png
137 ppt         application/vnd.ms-powerpoint
138                                         Microsoft PowerPoint Document
139 pptx        application/vnd.openxmlformats-officedocument.presentationml.presentation
140                                         Microsoft OpenXML Presentation
141 rtf         application/msword          Rich Text Format
142             text/rtf
143             application/rtf
144 tif, tiff   image/tiff                  Tag Image File Format
145 tsr, tst    application/timestamp-reply 
146                                         Time Stamp Token (RFC 3161)
147 txt         text/plain                  Plain text
148                                         (no charset nor encoding signalled)
149 wav         audio/wav                   RIFF Waveform Audio File Format
150             audio/wave
151             audio/x-wav
152 xls         application/vnd.ms-excel    Microsoft Excel Document
153 xlsx        application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
154                                         Microsoft OpenXML WorkBook
155 xml         application/xml             Extensible MarkUp Language
156             text/xml
157 xsd         application/xml             XML Schema
158             text/xml
159 zfo         application/vnd.software602.filler.form-xml-zip
160                                         602XML form (zipped XML form with
161                                         XSL-FO styles) or data box message
163 Document ::= Binary_Document | XML_Document
165 Document is Base64 encoded binary format or XML.
167 There exist special Document type, ESS format, that can exist in Content only
168 once.
170 Note: ESS format is special XML language designed as interface between
171 Electronic Document Systems (ESS). It's defined in Appendix 4 of Provozní řád
172 ISDS.
174 Message with `malicious code' will be refused by ISDS.
176 Maximal total size of Documents in a Message is 10 MB. Binary document size is
177 size before encoding into Base64, XML document size is size in bytes as is
178 serialized inside SOAP request.
180 A Message can be addressed to 50 recipients at maximum.
182 Life time of Message:
184     – 90 days for delivered message, 100 days for system message
185     – unlimited for delivered through fiction messages, however they can be
186     moved to off-line storage after 90 days. User can request to move the
187     Message back into his box (off-line only currently).
189 Deleted messages are stored off-line as Envelope only without Content. Since
190 2010-06-01, some services has access to off-line stored envelopes
191 (Get(Signed)DeliveryInfo, MessageEnvelopeDownload, VerifyMessage,
192 AuthenticateMessage).
194 Note: Delivery through fiction is currently defined as new unread for more
195 than 10 days after delivery.
198 Digital Signatures
199 ==================
201 Some SOAP services (GetSignedDeliveryInfo etc.) returns response that embeds
202 digitally signed ISDS message or delivery info. The digital signature is
203 Base64-encoded BER CMS. (xmldsig is not used to avoid expensive XML
204 canonicalization).
206 The CMS should carry one certificate and one signed body.
208 Since 2011-04, a time stamp is embedded into the CMS (get-message responses
209 currently only). The data structure is compliant with RFC 5126 (CMS Advanced
210 Electronic Signatures (CAdES)) and RFC 3161 (Internet X.509 Public Key
211 Infrastructure Time-Stamp Protocol (TSP)).
213 Stamp is stored in id-aa-signatureTimeStampToken object (iso(1).
214 member-body(2).us(840).rsadsi(113549).pkcs(1).pkcs-9(9).smime(16).
215 id-aa(2).14). Input for stamp is CMS SignerInfo.SignatureValue object.
217 Since 2014-09, the time stamp conforms to ATSv3 format defined by CAdES
218 Signatures Baseline Profile, ETSI TS 103 173, version 2.2.1. See
219 <http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=41927>.
221 The signature and time stamp is computed on-the-fly, for each reponse again.
223 If time stamp authority is irresponsive, CMS without time stamp is returned
224 with special ISDS error code 0005. Client can retry to get the same stamped
225 response two times in 20 minutes. Exceeding this quota leads to 50-second
226 delay or error code 3005.
228 If time stamp authority is failing, error code 9502 is returned without any
229 message. 
232 Message hash
233 ============
235 Message checksum is a hashed bit stream of part of a message. Exact message
236 part to hash must preserve physical XML serialization. The hash value is
237 carried inside a message, it's stored in ISDS and it's used as a input form
238 digital time stamp.
240 Currently SHA-1 and SHA-256 algortihms are defined. They are identified by
241 dmHash/@algorithm attribute. Algorithm name in attribute value contains hyphen
242 character.
245 System messages
246 ===============
248 There exists special message type initiated by ISDS (i.e. from system, not
249 from other box). Such message has reserved from-box `aaaaaaa' (7 × `a') value
250 and sender type `0' and it always contains a document of type HTML and
251 sometimes a document of type XML. The XML one provides structured reason of
252 sending the system message, the HTML one is a human-readable form. There are
253 following cases defined:
255 Case    Meaning
256 -------------------------------------------------------------------------------
257 1       Outgoing message contained malicious code.
258 2       You, administrator, deleted other user.
259 3       Outgoing message could not been delivered because recipient box had
260         been made inaccessible retrospectively.
261 4       Outgoing commercial message has been deleted before accepting it by the
262         recipient.
263 5       User has been added to your box.
264 6       User permissions has been changed.
265 7       Box has been made temporary inaccessible on court desicion (e.g. user
266         has been found eligable unresponsible).
267 8       Box has been made temporary inaccessible on box owner or administrator
268         request.
269 9       Box has been made permanently inaccessible because organization does
270         not exist anymore.
271 10      Box has been made permanently inaccessible because owner has died.
272 11      Personal data of box owner does not match central register.
274 The XML document has following structures:
276 SystemMessage – Attribute `type' is a number of case 1, 3, or 4.
277     + dmID – message ID
278     + dbIDRecipient – recipient box ID
280 SystemMessage – Attribute `type' is a number of case 2, 5, or 6.
281     + userID – user ID
282     + userName – user proper name
284 SystemMessage – Attribute `type' is a number of case 7, 8, 9, 10, or 11.
285     No elements are defined.
288 Notification messages
289 =====================
291 ISDS administrator can send business messages from dedicated box `zzzzzzq'.
292 Such a message contains a PDF document with a notification about business
293 activities of the ISDS administrator. Business activity is e.g. a support
294 for commercial messages.
296 Non-normative: The originating box as well as the message are of type system.
299 Commercial messages
300 ===================
302 Users can allow commercial message receiving explicitly in opposite to
303 standard messages.
305 User can request to assign permission to send commercial messages. Permission
306 can be assigned by Czech Post. Or sending some commercial messages can be
307 offered and paid by third party. Then user don't need special permission from
308 Czech Post to send the specific commercial message. See PDZInfo service for
309 more details. Commercial recipient can not be searched. Sender must know exact
310 box ID.
312 Commercial outgoing message is automatically recognized by ISDS using sender
313 and recipient box type, commercial sending/receiving permission, and OVM
314 message flag. All messages are noncommercial, so called public, except
315 following combinations when the message is considered as commercial:
317         Sender                         Recipient
318 Gross type  Commercial sending  Gross type  Commercial receiving    OVM flag
319 ----------------------------------------------------------------------------
320 non-OVM     allowed             non-OVM     allowed                 any
321 any         any                 non-OVM     allowed                 false
323 When sending message, the commercial status can be refined by @dmType
324 attribute in the message envelope:
326 Value   Meaning
327 -----------------------------------------------------------------------------
328 I       Commercial message offering paying the response instead of the
329         recipient (so called initiatory message)
330 K       Commercial message
331 O       Commercial message as a response paid by sender of initiatory message
332 V       Noncommercial standard message
334 Incoming message or downloaded sent message can have @dmType attribute in the
335 message envelope with following meaning:
337 Value   Meaning
338 -----------------------------------------------------------------------------
339 A       Subsidized initiatory commercial message which can pay a response
340 B       Subsidized initiatory commercial message which has already paid the
341         response 
342 C       Subsidized initiatory commercial message where the response offer has
343         expired
344 D       Externally subsidized commercial messsage
345 E       Prepaid stamp
346 G       Paid by a sponsor
347 I       Initiatory commercial message which can pay a response
348 K       Commercial message paid by sender
349 O       Commercial message as a response paid by sended of initiatory message
350 X       Initiatory commercial message where the response offer has expired
351 Y       Initiatory commercial message which has already paid the response
352 Z       Limitedly subsidized commercial message
354 Missing @dmType attribute means noncommercial standard message.
356 Relation between initiatory message and reply paid by initiatory message
357 sender is established by an identifier defined in dmSenderRefNumber element of
358 initiatory message and the same value copied into dmRecipientRefNumber element
359 of response message.
362 Message states
363 ==============
365 Value   Meaning
366 1       Message has been put into ISDS
367 2       Message stamped by TSA
368 3       Message included viruses, infected document has been removed
369 4       Message delivered (dmDeliveryTime stored)
370 5       Message delivered through fiction (dmAcceptanceTime stored)
371 6       Message delivered by user log-in or user explicit request (in case of
372         commercial message) (dmAcceptanceTime stored)
373 7       Message has been read by user
374 8       Message could not been delivered (e.g. recipient box has been made
375         inaccessible meantime)
376 9       Message content deleted (thus can not be obtained on-line)
377 10      Message saved in long term storage (this is optional commercial service)