Diplomatics

Diplomatics is a discipline which is concerned with the analysis of historical documents. The word goes back to "diploma", which literally means folded (document). Using the term diplomatics for this science is probably due to a work called "De re diplomatica", by Jean Mabilon (1632-1707). Note also, that the term is unrelated to diplomacy. 
The discipline originally evolved as a tool for studying and determining the authenticity of the official charters and diplomas issued by royal and papal chanceries. It was later found that many of the same underlying principles could be applied to other types of official document and legal instrument, to non-official documents such as private letters, and, most recently, to the metadata of electronic records.
Diplomatics is one of the auxiliary sciences of history. It should not be confused (as it often is) with its sister-discipline of palaeography. In fact, its techniques have more in common with those of the literary disciplines of textual criticism and historical criticism.