doc: Changing password with enabled OTP authentication
[libisds.git] / doc / message
blob497210328b13d598038e7801318cfcca8a41908a
1 Message specification
2 =====================
4 Source: Provozní řád ISDS, version 2010-11-28, Page 14
5 Source: Webové služby rozhranní ISDS pro manipulaci s datovými zprávami,
6     version 2.18 (2011-04-14)
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. Since 2011-04,
207 a time stamp is embedded into the CMS (get-message responses currently only).
208 The data structure is compliant with RFC 5126 (CMS Advanced Electronic
209 Signatures (CAdES)) and RFC 3161 (Internet X.509 Public Key Infrastructure
210 Time-Stamp Protocol (TSP)).
212 Stamp is stored in id-aa-signatureTimeStampToken object (iso(1).
213 member-body(2).us(840).rsadsi(113549).pkcs(1).pkcs-9(9).smime(16).
214 id-aa(2).14). Input for stamp is CMS SignerInfo.SignatureValue object.
216 The signature and time stamp is computed on-the-fly, for each reponse again.
218 If time stamp authority is irresponsive, CMS without time stamp is returned
219 with special ISDS error code 0005. Client can retry to get the same stamped
220 response two times in 20 minutes. Exceeding this quota leads to 50-second
221 delay or error code 3005.
223 If time stamp authority is failing, error code 9502 is returned without any
224 message. 
227 Message hash
228 ============
230 Message checksum is a hashed bit stream of part of a message. Exact message
231 part to hash must preserve physical XML serialization. The hash value is
232 carried inside a message, it's stored in ISDS and it's used as a input form
233 digital time stamp.
235 Currently SHA-1 and SHA-256 algortihms are defined. They are identified by
236 dmHash/@algorithm attribute. Algorithm name in attribute value contains hyphen
237 character.
240 System messages
241 ===============
243 There exists special message type initiated by ISDS (i.e. from system, not from
244 other box). Such message has reserved from-box `aaaaaaa' (7 × `a') value and
245 sender type `0' and it contains always document of type HTML. There are
246 following cases defined:
248 1   Outgoing message contained malicious code
249 2   You, administrator, deleted other user
250 3   Outgoing message could not been delivered because recipient box had been
251     made inaccessible retrospectively.
252 4   Outgoing commercial message has not been accepted by recipient
253 5   User has been added to your box
254 6   User permissions has been changed
255 7   Box has been made temporary inaccessible on court desicion (e.g. user has
256     been found eligable unresponsible)
257 8   Box has been made temporary inaccessible on box owner or administrator
258     request
259 9   Box has been made permanently inaccessible because organization does not
260     exist anymore
261 10  Box has been made temporary (??? specification says temporary, not
262     permanently) inaccessible because person has died
265 Commercial messages
266 ===================
268 Users can allow commercial message receiving explicitly. Commercial message
269 are not considered as accepted by recipient automatically (in opposite to
270 standard messages), recipient must call ConfirmDelivery to move message from
271 state Delivered (4) to state Received (6).
273 User can request to assign permission to send commercial messages. Permission
274 can be assigned by Czech Post. Commercial recipient can not be searched. Sender
275 must know exact box ID.
277 Incomming commercial message can be recognised by @dmType="K" in message
278 envelope. If @dmType is "V" or attribute is missing, message is so called
279 public (i.e. standard noncommercial with acceptance time outs etc.).
281 How does ISDS determine (non-)commercial status of outgoing message?
282 The decision is based on sender and recipient box type, commercial
283 sending/receiving permission and OVM message flag:
285 All messages are public except following combinations when message is
286 considered as commercial:
288         Sender                         Recipient
289 Gross type  Commercial sending  Gross type  Commercial receiving    OVM flag
290 ----------------------------------------------------------------------------
291 non-OVM     allowed             non-OVM     allowed                 any
292 any         any                 non-OVM     allowed                 false
295 Message states
296 ==============
298 Value   Meaning
299 1       Message has been put into ISDS
300 2       Message stamped by TSA
301 3       Message included viruses, infected document has been removed
302 4       Message delivered (dmDeliveryTime stored)
303 5       Message delivered through fiction (dmAcceptanceTime stored)
304 6       Message delivered by user log-in or user explicit request (in case of
305         commercial message) (dmAcceptanceTime stored)
306 7       Message has been read by user
307 8       Message could not been delivered (e.g. recipient box has been made
308         inaccessible meantime)
309 9       Message content deleted (thus can not be obtained on-line)
310 10      Message stored into data safe (this is optional commercial service)