Object types mature
On file systems, file name extensions are used to define the type of a file. In addition, many file formats write a magic number somewhere close to the beginning of the file, allowing them to be recognized by reading the first few bytes.
Condensation does not store any type along with an object. Type information is supposed to be stored (implicitly or explicitly) in the parent object.
Since objects are encrypted, it would not make a lot of sense to store type information with the object itself, because:
- Leaving the object type unencrypted may leak information about the content.
- If the object type was encrypted, it would only be accessible through the parent object (which contains the encryption key). Hence, type information can as well be stored in the parent object.
The type of root objects, i.e. objects with an envelope as parent, is given by the box type:
- The in-queue box always contains envelopes referencing a message record. Message records usually contain a type flag.
- The content of the private box is appplication specific. Since this box is always used by the same application, there is no need to store explicit type information. If the application is using a data tree, each entry refers to an envelope referencing a data tree record.
- The public box always contains an envelope referencing a card record.
Note that storing type information in an envelope is not safe, as it is neither encrypted nor signed.