<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="exp" docName="draft-ietf-ltans-ers-03" ipr="full3978">
  <front>
    <title abbrev="ERS">Evidence Record Syntax (ERS)</title>

    <author fullname="Ralf Brandner" initials="R." surname="Brandner">
      <organization>InterComponentWare AG</organization>

      <address>
        <postal>
          <street>Otto-Hahn-Str. 3</street>
          <city>Walldorf</city>
          <code>D-69119</code>
          <country>Germany</country>
        </postal>
        <email>ralf.brandner@intercomponentware.com</email>
      </address>
    </author>
    <author fullname="Ulrich Pordesch" initials="U." surname="Pordesch">
      <organization>Fraunhofer Gesellschaft</organization>

      <address>
        <postal>
          <street>Dolivostrasse 15</street>
          <city>Darmstadt</city>
          <code>D-64293</code>
          <country>Germany</country>
        </postal>
        <email>ulrich.pordesch@zv.fraunhofer.de</email>
      </address>
    </author>
	<author initials="T." surname="Gondrom" fullname="Tobias Gondrom">
      <organization>Open Text Corporation</organization>
      <address>
        <postal>
          <street>Technopark 2</street>
          <street>Werner-von-Siemens-Ring 20</street>
          <city>Grasbrunn</city>
          <region>Munich</region>
          <code>D-85630</code>
          <country>Germany</country>
        </postal>
		<phone>+49 (0) 89 4629-1816</phone>
        <facsimile>+49 (0) 89 4629-33-1816</facsimile>
        <email>tobias.gondrom@opentext.com</email>
      </address>
    </author>
    <date day="14" month="October" year="2005" />
    <area>Security Area</area>

    <workgroup>Long-term Archive And Notary Services (LTANS)</workgroup>

    <keyword>long term archive</keyword>
    <keyword>security</keyword>
    <keyword>timestamp</keyword>

    <abstract>
      <t>In many scenarios, users need to be able to ensure and prove the
      existence and integrity of data, especially digitally signed data, in a
      common and reproducible way over a long and possibly undetermined period
      of time. This document specifies the syntax and processing of an
      Evidence Record, designed for long-term non-repudiation of existence of
      data, which particularly can be used for conservation of evidence of
      digitally signed data.</t>
    </abstract>
    <note title="Conventions used in this document">
    <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].</t>
  </note>
  </front>
  
  
  <middle>
    <section title="Introduction">
      <t></t>

      <section title="Motivation">
        <t>In many application areas of electronic data exchange a
        non-repudiation proof of existence of digital data has to be
        possible over long periods of time. An important example are digitally
        signed data, which sometimes have to be archived conclusively over 30
        years or more. During the archiving period hash algorithms and public
        key algorithms or their parameters can become weak or certificates can
        become invalid. To avoid that digitally signatures lose their
        probative force it has to be provable that the data already existed
        before such a critical event. This can be done by timely generating
        Time-Stamps for these data and by the renewal of these Time-Stamps
        during the archival period.</t>

        <t>It is necessary to standardize data formats and processing
        procedures for such Time-Stamps in order to be able to verify and
        communicate archived data preserving evidence. A first approach was
        made by IETF within [RFC3126], where an optional Archive Time-Stamp
        Attribute was specified for integration in signatures according to the
        Cryptographic Messages Syntax (CMS) [RFC3852]. </t>
        <t>Evidence Record Syntax (ERS) broadens and generalizes this approach for data of any format
        and takes Long-term archive service requirements [REQ2004] into
        account, in particular, the handling of huge numbers of data objects.
        ERS specifies a syntax for an Evidence Record, which contains Archive
        Time-Stamps and some additional data. This Evidence Record can be
        stored as an additional file to signed data (ER as file format) or
        integrated in signed data (ER as part of another syntax
        specification). ERS also specifies processes for generation and
        verification of Evidence Records and as an appendix integration and
        use in context of signed and enveloped messages according to CMS. ERS
        does not specify a protocol, instead, this is done in a complementary
        LTANS specification.</t>
      </section>
      
      <section title="General Overview and Requirements">
        <t>ERS meets requirements for data structures set forth in [REQ2004].</t>
        
        <t>The basis of the ERS are Archive Time-Stamps, which can refer to a
        single data object (same as ordinary time-stamps) or to a group of
        data objects. An Archive Time-Stamp can be derived from hash-trees,
        first described by Merkle [Mer1980], combined with a time-stamp. The
        leaves of the hash-tree are hash values of the data objects. A
        time-stamp is requested only for the root hash of the hash-tree. The
        deletion of any referred data objects does not influence the
        provability of others. The hash-tree can be reduced to a few little
        sets of hash values, necessary to prove existence of a single data
        object or a data object group. These sets of hash values and the
        time-stamp yield the Archive Time-Stamp. </t>
        
        <t>For the generation of the
        Initial Archive Time-Stamp the data objects to be time-stamped have to
        be determined - depending on the context of ERS use, e.g. this could
        be a file, or a data object group consisting of multiple files, such
        as a document and its associated digital signature. </t>
        
        <t>Before
        cryptographic algorithms used within the Archive Time-Stamp become
        weak or time-stamp certificates become invalid, Archive Time-Stamp
        have to be renewed by generating a new Archive Time-Stamp. ERS
        distinguishes two ways for renewal of an Archive Time-Stamp, the
        simple Time-Stamp Renewal and the complex Hash-Tree Renewal. </t>
        
        <t>In the
        case of Time-Stamp Renewal the time-stamp of an Archive Time-Stamp has
        to be hashed and time-stamped by a new Archive Time-Stamp. It is not
        necessary to access the initially archived data objects itself. This
        simple form of renewal is sufficient, if only the hash algorithm or
        the public key-algorithm of the time-stamp of an Archive Time-Stamp is
        going to lose its security suitability or the time-stamp certificates
        get invalid. This is very efficient in particular, if Archive
        Time-Stamping is done by an archiving system or service, which
        implements a central management of Archive Time-Stamps.<vspace blankLines="0" /> 
        Time-Stamp renewal is not sufficient if the hash algorithm of the hash-tree of an
        Archive Time-Stamp becomes insecure. In the case of Hash-Tree Renewal
        not only the time-stamps but also the complete Archive Time-Stamps and
        the referred archived data objects have to be hashed and time-stamped
        again by a new Archive Time-Stamp. It is necessary to get the referred
        data objects and other Archive Time-Stamps.</t>
      </section>

      <section title="Terminology">
        <t>
        <list>
        <t>Archived data object: Data unit that is archived and has to be 
		preserved for a long time by the Long-term Archive Service.</t>

		<t>Archived data object group: A multitude of data objects, which for
		some reason belong together. E.g. a document file and a signature 
		file could be a archived data object group, which represent signed
		data.</t>
		   
		<t>Archive Time-Stamp: Is a time-stamp and lists of hash values, which
		allows to verify the existence of several data objects at a certain
		time.</t>

		<t>Evidence: Information that may be used to resolve a dispute about 
		various aspects of authenticity of archived data objects.  </t>
		     
		<t>Evidence record: Collection of evidence compiled for one or more 
		given archived data objects over time.  An evidence record include
		all Archive Time-Stamps and additional verification data, like 
		certificates, revocation information, trust anchors, policy details, 
		role information, etc. </t>

		<t>Reduced hash-tree: The process of reducing a Merkle hash-tree 
		[MER1980] to a list of lists of hash values. This is the basis of
		storing the evidence for a single data object.</t>
		        
		<t>Time-Stamp: A signed confirmation generated by a Time Stamping 
		Authority (TSA) that a data item existed at a certain time.
		[RFC3161] specifies a good structure for time-stamps and a protocol
		for communicating with a Time-stamp Authority (TSA).  </t>
		     
		<t>Trusted archive authority (TAA):   A service responsible for 
		preserving data for long periods of time, including generation and 
		collection of evidence, storage of archived data objects and evidence, etc.  A.K.A. Long-term archive service. </t> 

		<t>Archive Time-Stamp Chain: Is a time-ordered sequence of Archive 
		Time-Stamps, where each Archive Time-Stamp preserves non-repudiation
		of the previous Archive Time-Stamp, even after the previous Archive
		Time-Stamp becomes invalid. Overall non-repudiation is maintained
		until the new Archive Time-Stamp itself becomes invalid. The process
		of generating such an Archive Time-Stamp Chain is called Time-Stamp
		Renewal.</t>

		<t>Archive Time-Stamp Sequence: Is a sequence of Archive Time-Stamp
		Chains, where each Archive Time-Stamp Chain preserves non-repudiation
		of the previous Archive Time-Stamp Chains, even after the hash
		algorithm used within the previous Archive Time-Stamps hash-tree
		became weak. Non-repudiation is preserved until the last Archive
		Time-Stamp of the last chain becomes invalid. The process of
		generating such an Archive Time-Stamp Sequence is called Hash-Tree
		Renewal.</t>
		</list>
		</t>
		<t>An Archive Time-Stamp relates to a data object, if the hash value of
		this data object is part of the first hash value list of the Archive
		Time-Stamp. An Archive Time-Stamp relates to a data object group, if
		it relates to every data object of the group and no other data
		objects. An Archive Time-Stamp Chain relates to a data object / data
		object group, if its first Archive Time-Stamp relates to this data 
		object/data object group. An Archive Time-Stamp Sequence relates to
		a data object / data object group, if its first Archive Time-Stamp
		Chain relates to this data object/data object group.</t>
      </section>
    </section>
    <section title="Evidence Record">
    <t>An Evidence Record is a unit of data, which is to be used to prove
	the existence of an archived data object or an archived data object
	group at a certain time. The Evidence Record contains Archive 
	Time-Stamps, generated during a long period of archiving and possibly 
	useful data for validation. It is possible to store this Evidence 
	Record separately from the archived data objects or to integrate it
	into the data itself. For data types signed data and enveloped data
	of the CMS integration is specified in Appendix A.</t>
	  
	  <section title="Syntax">
      <t>Evidence Record has the following ASN.1 Syntax:</t>
<figure><artwork>
EvidenceRecord ::= SEQUENCE {
   version                   INTEGER { v1(1) },
   digestAlgorithms          SEQUENCE OF AlgorithmIdentifier,
   
   cryptoInfos               [0] CryptoInfos OPTIONAL,
   encryption                [1] EncryptionMethod OPTIONAL, 
   archiveTimeStampSequence  ArchiveTimeStampSequence}
CryptoInfos ::= SEQUENCE SIZE (1..MAX) OF CryptoInfo 

CryptoInfo ::= SEQUENCE 
{ 
   cryptoInfoType    OBJECT IDENTIFIER 
   cryptoInfoValue   ANY DEFINED BY cryptoInfoType 
}</artwork></figure>

   <t>The fields have the following meanings:</t>

   <t>version is the syntax version number, for compatibility with future
   revisions of this specification.</t>

   <t>digestAlgorithms is a sequence of all the hash algorithms used to
   hash the data object over the archival period.</t> 
   <t>cryptoInfos allows the storage of data useful in the validation of
   the archiveTimeStampSequence.  This could include possible 
   TrustAnchors, certificates, revocation information or the current
   definition of the suitability of cryptographic algorithms, past and
   present (e.g. RSA 768bit valid until 1998, RSA 1024bit valid until 
   2008, SHA1 valid until 2010). These items may be added based on the
   policy used. Since this data is not protected within any time-stamp,
   the data should be current and somehow verifiable. Such verification
   is out-of-scope of this document.</t>
 
   <t>ArchiveTimeStampSequence is a sequence of ArchiveTimeStampChain,
   described in chapter 4.</t>

   <t>If the archive data objects were encrypted before generating Archive
   Time-stamps but a non-repudiation proof is needed for unencrypted
   data objects, the optional field encryption contains data necessary
   to re-encrypt data objects. If left out, it means that data objects
   are not encrypted. For further details see chapter 5.</t>

      </section>
    
      <section title="Generation">
      <t>The generation of an EvidenceRecord overall can be described as follows:</t>
	  <list style="numbers">
      <t>Select archived data object or an archived group of data objects,
      which are documents or essential parts of it - depending on application. 
      In the case that only essential parts of documents or objects shall be covered
      the application not defined in this draft MUST take care of the right extraction 
      of binary data to be covered for generation EvidenceRecord and their verification.</t>

	  <t>Create Initial Archive Time-Stamp (see Archive Time-Stamp chapter 3).</t>

	  <t>Renew this Archive Time-Stamp when necessary, by Time-Stamp Renewal or Hash-Tree Renewal (see chapter 4).</t>
	  </list>

     <t>The process of generation depends on whether the Archive Time-Stamps
     are generated, stored and managed by a centralized instance or not.
     In case of central management it is possible to collect data objects
     from many documents, to build hash-trees, store them and reduce them
     later. In case of local generation it might be easier to generate a
     simple Archive Time-Stamp without building hash-trees and reducing
     them. Details of local generation procedure are not to be discussed
     in this specification.</t>

     </section>
     <section title="Verification">
     <t>The Verification of an EvidenceRecord overall can be described as 
     follows:</t>
	  <list style="numbers">
   <t>Select archived data object or a group of data objects, which were
      originally Archive Time-Stamped. </t>
   <t>Re-encrypt data object/data object group, if encryption field
      is used (details see chapter 5)</t>
   <t>Verify Archive Time-Stamp Sequence (details in chapter 3 and 4).</t>
	  </list>
     </section>
    </section>
    <section title="Archive Time-Stamp"> 
    <t>An Archive Time-Stamp is a time-stamp and some lists of hash values,
    which allow verification of the existence of a data object or a data 
    object group at a certain time. The lists of hash values can be
    generated by reduction of an ordered Merkle hash-tree [Mer1980]. The
    leaves of this hash-tree are the hash values of the data objects to
    be time-stamped. Every inner node of the tree contains one hash 
    value, which is generated by hashing the concatenation of the 
    children nodes. The root hash value, which represents unambiguously
    all data objects, is time-stamped.</t>
		<section title="Syntax">
		<t>An Archive Time-Stamp has the following ASN.1 Syntax:</t>
   
<figure><artwork>
ArchiveTimeStamp ::= SEQUENCE {
  digestAlgorithm AlgorithmIdentifier OPTIONAL,
  reducedHashtree [0] SEQUENCE OF {SEQUENCE OF OCTET STRING} 
                                                   OPTIONAL,
  timeStamp       ContentInfo}
</artwork></figure>
   <t>The fields of type ArchiveTimeStamp have the following meaning:</t>

   <t>digestAlgorithm identifies the digest algorithm and any associated 
   parameters used within the reduced hash-tree. If the optional field 
   digestAlgorithm is not present the digest algorithm of the
   time-stamp must be used. If time-stamps according to [RFC3161] are
   used, the content of this field must be identical to hashAlgorithm
   of messageImprint-Field of timeStampToken.</t>

   <t>reducedHashtree contains lists of hash values, which could be 
   derived from a hash-tree by reduction to nodes necessary for 
   verification of a single data object. Hash values are represented as
   octet strings. If the optional field reducedHashtree is not existent
   the Archive Time-Stamp is equal to the ordinary time-stamp.</t>
   
   <t>timeStamp should contain the time-stamp which is defined as 
   timeStampToken in [RFC 3161]. Other types of time-stamp might be
   used, if they contain time data, time-stamped data and a signature
   from the TSA of these data.</t>

		</section>
		<section title="Generation">
		<t>The lists of hash values of an Archive Time-Stamp can be generated
   by the way of building and reducing a Merkle hash-tree [Mer1980].</t>
   <t>Such a hash-tree can be built as follows:</t>
<list style="numbers">
   <t>Collect data objects to be time-stamped.</t>

   <t>Choose secure hash algorithm H and generate hash values for the
      data objects, which will be the leaves of the hash-tree.</t>

   <t>For each data group containing more than one document, its 
      respective document hashes are binary sorted in ascending order,
      concatenated and hashed.</t>

   <t>If there is more than one hash value, place them in groups and
      sort each group in binary ascending order. Concatenate these 
      values and generate new hash values, which are inner nodes of 
      this tree.  (If additional hash values are needed, e.g. so that
      all nodes have the same number of children, any data may be
      hashed using H and used.) Repeat this step until there is only 
      one hash value, which is the root node of the hash-tree. </t>

   <t>Order a time-stamp for this root hash value. The hash algorithm
      in the time-stamp request must be the same as the hash algorithm
      of the hash-tree.</t>
</list>

<t>An example of a constructed hash tree for 3 data groups, where data
group 1 and 3 only contain one document, and data group 2 contains 3
documents: </t>
<figure><artwork> 
              +------+
              | h123 |
              +------+
            /         \
           /           \
        +----+      +----+
        | h12|      | h3 |
        +----+      +----+
        /     \        
       /       \      
    +----+  +-------+     
    | h1 |  | h2abc |     
    +----+  +-------+     
            /   |   \
           /    |    \
          /     |     \
         /      |      \
     +----+  +----+  +----+
     | h2a|  | h2b|  | h2c|
     +----+  +----+  +----+
</artwork><postamble>Figure 1: Hash-tree</postamble>
</figure>

<figure><artwork>
  h1 = H(d1) where d1 is the only data object in data group 1
  h3 = H(d3) where d3 is the only data object in data group 3
  h12 = H( binary sorted and concatenated (h1, h2abc))
  h123 = H( binary sorted and concatenated (h12, h3))
  h2a = H(first data object of data object group 2)
  h2b = H(second data object of data object group 2)
  h2c = H(third data object of data object group 2)

  h2abc = H( binary sorted and concatenated (h2a, h2b, h2c))
</artwork></figure>

   <t>The hash-tree can be reduced to lists of hash values, necessary to
   have a proof of existence for a single data object:</t>
<list style="numbers">
   <t>Generate hash value h of the data object, using hash algorithm H
      of the hash-tree.</t>

   <t>Select all hash values, which have the same father node as h. 
      Generate the first list of hash values by arranging these hashes,
      in binary ascending order. Repeat this step for the father node
      of these hashes until the root hash is reached. The father nodes
      are not saved in the hash lists - they are computable.</t>

   <t>Generate a reduced hash-tree by building the sequence of these
      hash value lists. Then add the time-stamp and the hash algorithm
      to get an Archive Time-Stamp.</t>
</list>

<t>Assuming that the sorted binary ordering of the hashes in Figure 1 is:
  h2abc &lt; h1 then the reduced hash-tree for data group 1 (d1) is:</t>
<figure><artwork>
 +--------------------------------+
 | +----------------+  +--------+ |
 | | +------+  +----+  | | +----+ |
 | | | h2abc|  | h1 |  | | | h3 | |
 | | +------+  +----+  | | +----+ |
 | +----------------+  +--------+ |
 +--------------------------------+
</artwork><postamble>Figure 2: Reduced hash-tree for data group 1</postamble>
</figure>
<figure><artwork> 
   The pseudo ASN1 for this reduced hash-tree would look like:
     rht1 = SEQ( SEQ (h2abc, h1), SEQ (h3))
</artwork></figure>
    <t>Assuming the same hashtree as in figure 1 the reduced hash-tree
  for all data objects in data group 2 is identical.</t>
<figure><artwork>  
 +-------------------------------------------------+
 | +----------------------+  +--------+ +--------+ |
 | | +----+ +----+ +----+ |  | +----+ | | +----+ | |
 | | | h2b| | h2c| | h2a| |  | | h1 | | | | h3 | | |
 | | +----+ +----+ +----+ |  | +----+ | | +----+ | |
 | +----------------------+  +--------+ +--------+ |
 +-------------------------------------------------+
</artwork><postamble>Figure 3: Reduced hash-tree for data object group 2</postamble>
</figure>
<figure><artwork> 
   The pseudo ASN1 for this reduced hash-tree would look like:
     rht2 = SEQ( SEQ (h2b, h2c, h2a), SEQ (h1), SEQ (h3))
</artwork></figure>

   <t>Note, there are no restrictions to the quantity of hash value lists
   and of their length. Also note, that it is profitable but not
   required to build hash-trees and reduce them. An Archive Time-Stamp
   may consist only of one list of hash-values and a time-stamp or
   in the extreme case, only a time-stamp with no hash value lists.<vspace blankLines="0" />
   The certificates, CRLS or OCSP-Responses needed to verify the
   time-stamp SHOULD be stored in the time-stamp itself. A time-stamp 
   according to [RFC 3161] is a CMS-object in which certificates can be
   stored in the certificates field and CRLs can be stored in the crls
   field of signed data. OCSP responses can be stored as unsigned
   attributes [RFC3126].</t>
		</section>
		<section title="Verification">
		<t>An Archive Time-Stamp shall prove that a data object existed at a
   certain time, given by time-stamp. This can be verified as follows:</t>
<list style="numbers">
   <t>Calculate hash value h of the data object with hash algorithm H
      given in field digestAlgorithm of the Archive Time-Stamp.</t>
      
   <t>Search for hash value h in the first list of reducedHashtree. If 
      not present, terminate verification process with negative result.</t>
      
   <t>Concatenate the hash values of the actual list of hash values in binary ascending order and 
      calculate the hash value h with algorithm H. This hash value h 
      must become member of the next higher list of hash values.
      Continue step 3 until a root hash value is calculated.</t>
      
   <t>Check time-stamp. In case of time-stamp according [RFC 3161] the
      root hash value must correspond to hashedMessage and
      digestAlgorithm must correspond to hashAlgorithm field, both in
      messageImprint field of timeStampToken.</t>
</list>
   <t>If the proof is necessary for more than one data object, steps 1 and
   2 have to be done for all data objects to be proved. If an
   additional proof is necessary that the Archive Time-Stamp relates to
   a data object group (e.g. a document and all its signatures) it can
   be verified additionally, that only the hash values of the given data
   objects are in the first hash value list.</t>
		</section>
    </section>
    <section title="Archive Time-Stamp Chain and Archive Time-Stamp Sequence">
    <t>Archive Time-Stamps are used for archive time-stamping. An Archive
   Time-Stamp proves the existence of single data objects or data
   object group at a certain time. However, this first Archive
   Time-Stamp in the first ArchiveTimeStampChain can become invalid, if hash algorithms or public key 
   algorithms used in its hash-tree or time-stamp become weak or if the
   validity period of the time-stamp certificates expires or if the 
   time-stamp certificates are revoked. <vspace blankLines="0" />
   If this is going to happen, the existence of the Archive Time-Stamp or
   archive time-stamped data has to be reassured, which can be done by
   creating new Archive Time-Stamps. Depending on whether the time-stamp
   becomes invalid or the hash algorithm of the hash-tree becomes weak,
   two kinds of Archive Time-Stamp renewals are possible:</t>
<list style="symbols">

   <t>Time-Stamp Renewal: A new Archive Time-Stamp is generated, which
     refers to the time-stamp of the old one. One or more Archive
     Time-Stamps generated by Time-Stamp Renewal yield an Archive
     Time-Stamp Chain for a data object or data object group.</t>

   <t>Hash-Tree Renewal: A new Archive Time-Stamp is generated, which
     refers to all the old Archive Time-Stamps as well as the data 
     objects initially archive time-stamped. A new Archive Time-Stamp 
     Chain is created. One or more Archive Time-Stamp Chains for
     a data object or data object group yield an Archive Time-Stamp 
     Sequence.</t>
</list>
		<section title="Syntax">
		<t>ArchiveTimeStampChain and ArchiveTimeStampSequence have the
		following ASN.1 Syntax:</t>

<figure><artwork>
ArchiveTimeStampChain    ::= SEQUENCE OF ArchiveTimeStamp
ArchiveTimeStampSequence ::= SEQUENCE OF ArchiveTimeStampChain
</artwork></figure>

		<t>ArchiveTimeStampChain and ArchiveTimeStampSequence MUST be
		ordered ascending by time of time-stamp. Within an 
		ArchiveTimeStampChain all hash-trees and reducedHashtrees of the contained 
		ArchiveTimeStamps MUST use the same Hash-Algorithm.</t>
		</section>
		<section title="Generation">
		<t>A first Initial Archive Time-Stamp relates to a data object or a
   data object group. The application or the policy included in the 
   LTANS Long term Archiving Protocol (to be specified) dictate when
   an Initial Archive Time-Stamp must be generated for each data
   object. </t>
   
   <t>Before cryptographic algorithms used within the Archive Time-Stamp
   become weak or time-stamp certificates are invalidated, Archive
   Time-Stamps have to be renewed by generating a new Archive
   Time-Stamp.</t>

   <t>In the case of Time-Stamp Renewal the content of the timeStamp field
   of the old Archive Time-Stamp has to be hashed and time-stamped by a
   new Archive Time-Stamp. The new Archive Time-Stamp must use the same
   hash algorithm within its hash-tree as the old one, which is
   specified in the hash algorithm field of the Archive Time-Stamp or
   within the time-stamp itself.</t>

   <t>In the case of Hash-Tree Renewal not only the Archive Time-Stamp 
   but also the data objects referred to by the initial Archive
   Time-Stamp have to be hashed and time-stamped again:</t>
<list style="numbers">
   <t>Select secure hash algorithm H.</t>

   <t>Select data objects d(i) referred to by initial Archive
      Time-Stamp (objects which are still present and not deleted).<vspace blankLines="0" />
      Generate hash values h(i) = H((d(i)). If data groups with more
      than one document are present, then one will have more than one
      hash for a group, i.e. h(i_a), h(i_b).., h(i_n) </t>

   <t>atsc(i) is the encoded ArchiveTimeStampSequence, the concatenation 
      of all previous Archive Time-Stamp Chains (in chronological order) 
      related to data object d(i).<vspace blankLines="0" />
      Generate hash value ha(i) = H(atsc(i)).<vspace blankLines="0" />
      Note: The ArchiveTimeStampChains used are DER encoded, i.e. they 
      contain sequence and length tags.</t>

   <t>Concatenate each h(i) with ha(i) and generate hash values <vspace blankLines="0" />
      h(i)' = H (h(i)+ ha(i)). For multi-document groups, this is:<vspace blankLines="0" />
        h(i_a)' = H (h(i_a)+ ha(i))<vspace blankLines="0" />
        h(i_b)' = H (h(i_b)+ ha(i)) etc.</t>

   <t>Build a new Archive Time Stamp for each h(i)'. (hash-tree 
      generation and reduction is defined in 3.2, note that each h(i)'
      will be treated in 3.2 as the document hash. The first hash value
      list in the reduced hash-tree should only contain h(i)'. For a
      multi-document group, the first hash value list will contain the
      new hashes for all the documents in this group, i.e. h(i_a)',
      h(i_b)'.., h(i_n)')</t>
      
   <t>Create new ArchiveTimeStampChain and add this new Archive
      Time-Stamp.</t>
</list>

<figure><artwork>
              +-------+
              | h123' |
              +-------+
            /         \
           /           \
        +-----+      +----+
        | h12'|      | h3'|
        +-----+      +----+
        /     \        
       /       \      
    +----+  +--------+     
    | h1'|  | h2abc' |     
    +----+  +--------+     
            /   |   \
           /    |    \
          /     |     \
         /      |      \
     +----+  +----+  +----+
     |h2a'|  |h2b'|  |h2c'|
     +----+  +----+  +----+
<postamble>Figure 4: Hash-tree from hash-tree renewal</postamble>
</artwork></figure>
<figure><artwork>
  Let H be the new secure hash algorithm
  ha(1), ha(2), ha(3) are as defined in step 4 above
  h1' = H( binary sorted and concatenated (H(d1), ha(1)))
    d1 is the original document from data group 1
  h3' = H( binary sorted and concatenated (H(d3), ha(3)))
    d3 is the original document from data group 3

  h2a = H(first data object of data object group 2)
   ...
  h2c = H(third data object of data object group 2)
  h2a' = H( binary sorted and concatenated (h2a, ha(2)))
   ...
  h2c' = H( binary sorted and concatenated (h2c, ha(2)))

  h2abc = H( binary sorted and concatenated (h2a', h2b', h2c'))
</artwork></figure>

   <t>If the Time-Stamp of an Archive Time-Stamp becomes invalid, the
   simple time-stamp renewal should be done. Only if the hash algorithm
   used within the hash-tree becomes weak, Hash-Tree Renewal must be
   done. In case of centralized Archive Time-Stamping, Archive 
   Time-Stamps might be generated a long-time before other Archive
   Time-Stamps become invalid to be on the secure side. Nevertheless 
   ArchiveTimeStamps, which are not necessary for verification,
   should not be added to ArchiveTimeStampChain or 
   ArchiveTimeStampSequence.</t>

		</section>	
		<section title="Verification">
		<t>To get an non-repudiation proof that a data object existed at a
   certain time, the Archive Time-Stamp Chains and their relations to
   each other and to the data objects have to be proved:</t>
<list style="numbers">
   <t>Verify that the first Archive Time-Stamp of the first 
      ArchiveTimestampChain (the Initial Archive Time-Stamp) contains
      the hash value of the data object.</t>

   <t>Verify each ArchiveTimestampChain. The first hash value list of
      each ArchiveTimeStamp must contain the hash value of the
      time-stamp of the Archive Time-Stamp before. The Archive 
      Time-Stamp has to be valid at the time of the following Archive
      Time-Stamp. All Archive Time-Stamps within the chain must use the
      same hash algorithm and this algorithm must be secure at the time
      of the first Archive Time-Stamp of the following 
      ArchiveTimeStampChain.</t>

   <t>Verify that the first hash value list of the first Archive
      Time-Stamp of all other ArchiveTimeStampChains contains a hash
      value of the concatenation of the data object hash and the hash
      value of all older ArchiveTimeStampChain. Verify that this Archive 
      Time-Stamp was generated before the last Archive Time-Stamp of
      the ArchiveTimeStampChain became invalid.</t>
</list>

   <t>In order to complete the non-repudiation proof for the data
   objects, the last Archive Time-Stamp has to be valid.</t>

   <t>If the proof is necessary for more than one data object, steps 1
   and 3 have to be done for all these data objects. If an additional
   proof is necessary that the Archive Time-Stamp Sequence relates to
   a data object group (e.g. a document and all its signatures) it
   can be verified additionally, that each first Archive Time-Stamp of
   each ArchiveTimeStampChain does not contain other hash values in its
   first hash value list.</t>

		</section>
	</section>    
	<section title="Encryption">
	<t>If service providers are used to archive data and generate Archive
   Time-Stamps, it might be desirable or required that clients only send
   encrypted data to be archived. However, this means that evidence
   records refer to encrypted data objects and not to the unencrypted
   ones. To avoid problems when using the evidence records in the
   future, additional special precautions have to be taken:</t>
<list style="symbols">
   <t>Encryption can affect the proof of existence of the unencrypted
     data. E.g. it could be possible to choose an algorithm or a key
     for decryption that is not the algorithm or key used for 
     encryption. In this case, the evidence record would not be a 
     non-repudiation proof for the unencrypted data. Therefore, only
     encryption methods may be used, which make it possible to prove 
     that archive time-stamped encrypted data objects unambiguously
     represent unencrypted data objects. All data necessary to prove
     unambiguous representation have to be part of the archived data
     objects.</t>

   <t>When encrypted data objects and the evidence record are sent back,
     it may be desirable for clients to only store the unencrypted data
     objects and to delete the decrypted ones, in order to avoid
     duplicate storage. In order to use the evidence record, it must be
     then possible to re-encrypt the unencrypted data to get exactly the
     data that was originally archived. Therefore, additional data
     necessary to re-encrypt data objects should be inserted into the
     evidence record by the client (i.e. archive provider never sees
     these values).</t>
</list>
   
   <t>This specification defines an optional data field to store the
   needed parameters of the used encryption methods. One possible
   encryption method is specified.  Further encryption methods may be
   defined in other specifications.</t>
		
		<section title="Syntax">
		<t>Encryption-Field in ArchiveTimeStampsDocument has following Syntax:</t>
<figure><artwork> 
   EncryptionMethod ::= SEQUENCE { 
      encryptionAlgorithm   OBJECT IDENTIFIER,
      encryptionParameters  ANY DEFINED BY encryptionAlgorithm 
                                OPTIONAL}
</artwork></figure>
   <t>encryptionMethod refers to the algorithm used to encrypt the data 
   objects if used before Archive Time-Stamping.</t>

   <t>encryptionParameters contains specific parameters for the encryption
   algorithm and are necessary for verification and re-encryption.</t>
  
   <t>encryptionMethod is open for encryption methods, which fulfill the 
   above mentioned requirements. Instead of using a traditional
   encryption method it might be reasonable to define and use a
   surjective one-way function, if the service provider manages Archive
   Time-Stamping, but not document management.</t>

   <t>ERS specifies one EncryptionMethod on the basis of enveloped data
   of CMS-Standard using key transport technique with RSA public key
   encryption:</t>
<figure><artwork>
   
id-EncryptionCMS_encryptedmessage ::= {id-ATS-1}

CMS_encryption_params::= SEQUENCE { 
   encryptionCover ContentInfo,
   publicKey       BIT STRING OPTIONAL,
   params          CHOICE {
             [0] privateKey       BIT STRING,
             [1] encryptionKeyRan EncryptionKeyRandom}}

EncryptionKeyRandom::= SEQUENCE {
   encryptionKey   OCTET STRING,
   randomValue     BIT STRING}}
</artwork></figure>
   <t>encryptionCover is a CMS-message of type enveloped message, without 
   encrypted content (external content).</t>

   <t>publicKey is the public key used to encrypt encryptKey. This value
   must be present if the corresponding certificate is not included
   in the CMS structure, or if more than one certificate is included.</t>

   <t>privateKey is the private key corresponding to the public key given
   by the recipientInfo field. The private key can decrypt the
   encrypted document encryption key.</t>

   <t>encryptionKeyRan contains encryptionKey, the clear text of 
   content-encryption Key (used to encrypt the content (data objects)),
   and randomValue, the random value used in the encryption of the
   content-encryption key. Thus, one can re-encrypt encryptionKey
   using the randomValue using the public key in the recipientInfo.
   This encrypted result is compared with the encryptedKey of recipient
   info of Encryption-Cover. If it is the same, then encryptionKey can
   be used to re-encrypt the data objects.</t>

		</section>
		<section title="Generation">
		<t>When the client encrypts to-be-archived data objects, it must ensure
   that the needed encryption info is included in the archived data.</t>

   <t>In the case of CMS encryption, a CMS encrypted message has to be
   generated using the key transport technique, as described in
   [RFC3852]. Encrypted content must be part of the message. At 
   least one certificate must be added, which
   contains the public key used to encrypt the encryption key. The
   private key or randomValue used to encrypt the content encryption key
   has to be stored by the client for verification in the future. The
   client adds CMS_encryption_params to the Archive Time-Stamps Element,
   when a proof is necessary that this EvidenceRecord refers to the
   given unencrypted data.</t>

		</section>
		<section title="Verification">
		<t>If the EncryptionMethod field is used, verification of 
   Archive-Time-Stamps requires two additional steps:</t>
<list style="numbers">
   <t>Apply encryption method to reconstruct the encrypted data objects.</t>

   <t>Check whether the encryption key was applied before Archive
      Time-Stamping.</t>
</list>   

   <t>In case of CMS-Encryption this means:</t>
   
   <t>Time-stamped data objects can be reconstructed by encrypting
   selected data objects with encryptionKey and inserting result in
   Encryption-Cover. In order to get the identical Bitstream, that 
   originally was archive time-stamped, the encoding of the encrypted
   message must not be changed, with the exception of adapting the
   (preceding) length fields.</t>
   
   <t>To verify that the encryptionKey is the right one, it has to be
   verified that the encrypted key field contains the encrypted content
   encryption key. This can be done in two ways:</t>
<list style="symbols">
   <t>Re-encrypting: encryptionKey and randomValue must be provided.
     encryptionKey is re-encrypted using randomValue and the public key
     in recipient Info, which is contained in the certificate. The 
     result must be compared with encrypted key.</t>

   <t>Decrypting: privateKey must be provided. privateKey is used to
     decrypt encryptedKey, which provides the content-encryption key.</t>
</list>

		</section>
	</section>
	
	<section title="ASN.1-Module">
<figure><artwork>
ERS 
-- {iso(1) identified-organization(3) dod(6) internet(1)  
-- security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-ers(TBD) } 
 
DEFINITIONS IMPLICIT TAGS ::= 
 
BEGIN 
 
-- EXPORTS ALL -- 

IMPORTS 
    
TimeStampToken 
FROM
PKIXTSP {iso(1) identified-organization(3) dod(6) internet(1)  
security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-tsp(13) } 
  
 
ContentInfo 
FROM  
CryptographicMessageSyntax {iso(1) member-body(2) us(840)  
rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1)} 


ArchiveTimeStamp ::= SEQUENCE {
   digestAlgorithm    AlgorithmIdentifier,
   reducedHashtree   [0] SEQUENCE OF {SEQUENCE OF OCTET STRING } 
                                                        OPTIONAL,
   timeStamp         ContentInfo}


ArchiveTimeStampChain::=  SEQUENCE OF ArchiveTimeStamp

ArchiveTimeStampSequence::= SEQUENCE OF ArchiveTimeStampChain

EncryptionMethod ::= SEQUENCE { 
   encryptionAlgorithm OBJECT IDENTIFIER, 
   encryptionParameters::= ANY DEFINED BY encryptionAlgorithm 
                               OPTIONAL}

id-EncryptionCMS_encryptedmessage ::= {id-ATS-1}
   
CMS_encryption_params::= SEQUENCE { 
   encryptionCover ContentInfo,
   publicKey       BIT STRING OPTIONAL,
   params          CHOICE {
             [0] privateKey       BIT STRING,
             [1] encryptionKeyRan EncryptionKeyRandom}}

EncryptionKeyRandom::= SEQUENCE {
   encryptionKey   OCTET STRING,
   randomValue     BIT STRING}}

EvidenceRecord ::= SEQUENCE {
   version                   INTEGER { v1(1) },
   digestAlgorithms          SEQUENCE OF AlgorithmIdentifier,
   cryptoInfos               [0] CryptoInfos OPTIONAL,
   encryption                [1] EncryptionMethod OPTIONAL, 
   archiveTimeStampSequence  ArchiveTimeStampSequence}

CryptoInfos ::= SEQUENCE SIZE (1..MAX) OF CryptoInfo 
CryptoInfo ::= SEQUENCE 
{ 
   cryptoInfoType    OBJECT IDENTIFIER 
   cryptoInfoValue   ANY DEFINED BY cryptoInfoType 
}

END
</artwork></figure>
	
	</section>
	
    <section anchor="Security" title="Security Considerations">
    <t>Secure Algorithms</t>

   <t>Cryptographic algorithms and parameters which are used within
   Archive Time-Stamps must be secure at the time of generation. This
   concerns the hash algorithm used in the hash lists of Archive
   Time-Stamp as well as hash algorithms and public key algorithms of 
   the time-stamps. Publications regarding security suitability of 
   cryptographic algorithms ([ETSI2003]) have to be considered by 
   verifying components. A generic solution for automatic
   interpretation of security suitability policies in electronic form
   is desirable but not subject of this specification.</t>

   <t>Redundancy</t>
   
   <t>Algorithms can loose there security suitability untimely or Time
   Stamping Authorities may be considered as untrustworthy
   retrospectively. Therefore Archive Time-Stamps can lose their 
   probative force. If Archive Time-Stamps are managed centrally several
   redundant ArchiveTimeStampSequences can be generated using different
   hash algorithms and different Time Stamping Authorities.</t>

   <t>Secure Time-Stamps</t>

   <t>Archive Time-Stamping is as secure as normal time stamping. Security
   requirements for Time Stamping Authorities stated in security 
   policies have to be met. Renewed Archive Time-Stamps should have the
   same or higher quality as the Initial Archive Time-Stamp. Archive
   Time-Stamps used for signature renewal of signed data, should have
   the same or higher quality than maximum quality of the signatures.</t>

   <t>Secure Encryption</t>

   <t>For non-repudiation proof it does not matter, whether encryption has
   been broken or not. Nevertheless, users should keep secret their 
   private keys and randoms used for encryption and disclose them only
   if needed (e.g. in a lawsuit to a judge or expert). They should use
   encryption algorithms and parameters which are prospected to be 
   unbreakable as long as confidentiality of the archived data is 
   important.</t>
    </section>
    
    
    
<!--    
<section title="">
</section>

<vspace blankLines="0" />

<list style="numbers">
</list>

<figure><artwork>
</artwork></figure>
 
    <section anchor="IANA" title="IANA Considerations">
      <t>This document makes no request of IANA.</t>

      <t>Note to RFC Editor: this section may be removed on publication as an
      RFC.</t>
    </section>-->

  </middle>

  <back>
    <references title="Normative References">


<reference anchor='RFC2026'>

<front>
<title>The Internet Standards Process -- Revision 3</title>
<author initials='S.' surname='Bradner' fullname='Bradner, S.'>
<organization /></author>
<date year='1996'/></front>

<seriesInfo name='RFC' value='2026' />
<format type='TXT' target='http://www.ietf.org/rfc/rfc2026.txt' />
</reference>

<reference anchor='RFC2119'>

<front>
<title>Key Words for Use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Bradner, S.'>
<organization /></author>
<date year='1997'/></front>

<seriesInfo name='RFC' value='2119' />
<format type='TXT' target='http://www.ietf.org/rfc/rfc2119.txt' />
</reference>

<reference anchor='RFC3126'>

<front>
<title>Electronic Signature Formats for long term electronic signatures</title>
<author initials='C.' surname='Adams' fullname='Adams, C.'>
<organization /></author>
<author initials='D.' surname='Pinkas' fullname='Pinkas, D.'>
<organization /></author>
<author initials='J.' surname='Ross' fullname='Ross, J.'>
<organization /></author>
<author initials='N.' surname='Pope' fullname='Pope, N.'>
<organization /></author>
<date year='2001'/></front>

<seriesInfo name='RFC' value='3126' />
<format type='TXT' target='http://www.ietf.org/rfc/rfc3126.txt' />
</reference>


<reference anchor='RFC3161'>

<front>
<title>Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)</title>
<author initials='C.' surname='Adams' fullname='C. Adams'>
<organization /></author>
<author initials='P.' surname='Cain' fullname='P. Cain'>
<organization /></author>
<author initials='D.' surname='Pinkas' fullname='D. Pinkas'>
<organization /></author>
<author initials='R.' surname='Zuccherato' fullname='R. Zuccherato'>
<organization /></author>
<date year='2001' month='August' /></front>

<seriesInfo name='RFC' value='3161' />
<format type='TXT' octets='54585' target='http://www.ietf.org/rfc/rfc3161.txt' />
</reference>


<reference anchor='RFC3852'>
<front>
<title>Cryptographic Message Syntax (CMS)</title>
<author initials='R.' surname='Housley' fullname='Housley, R.'>
<organization /></author>
<date year='2004' month='July'/></front>
<seriesInfo name='RFC' value='3852' />
<format type='TXT' target='http://www.ietf.org/rfc/rfc3852.txt' />
</reference>
    
    </references>

    <references title="Informative References">

<reference anchor='ETS2003'>
<front>
<title>Algorithms and Parameters for Secure Electronic Signatures</title>
<author>
<organization>European Telecommunication Standards Institute (ETSI),
Electronic Signatures and Infrastructures (ESI);</organization>
</author>
<date year='2003' month='March'/></front>
<seriesInfo name="ETSI" value="SR 002 176 V1.1.1"/>
</reference>

<reference anchor='Mer1980'>
<front>
<title>Protocols for Public Key Cryptosystems,
             Proceedings of the 1980 IEEE Symposium on Security and 
             Privacy (Oakland, CA, USA)</title>
<author initials='R.' surname='Merkle' fullname='Merkle, R.'>
<organization></organization>
</author>
<date year='1980' month='April'/></front>
<seriesInfo name="pages" value="122-134"/>
</reference>

<reference anchor='REQ2004'>
<front>
<title>Long-term Archive Service Requirements</title>
<author initials='C.' surname='Wallace' fullname='Wallace, C.'>
<organization/></author>
<author initials='R.' surname='Brandner' fullname='Brandner, R.'>
<organization/></author>
<author initials='U.' surname='Pordesch' fullname='Pordesch, U.'>
<organization/></author>
<date year='2005'/></front>
<seriesInfo name="I-D" value="???"/>
</reference>
 

<!--      <reference anchor="InfRef">
        <front>
          <title></title>

          <author>
            <organization></organization>
          </author>

          <date year="2004" />
        </front>
      </reference> -->
      
    </references>

    <section title="Evidence Record using CMS">
   <t>An Evidence Record can be added to signed data or enveloped data in
   order to transfer them in a conclusive way. For CMS a sensible place
   to store such an Evidence Record is an unsigned attribute (signed
   message) or an unprotected attribute (enveloped message).</t>

   <t>The Evidence Record also contains information about the selection
   method which was used for the generation of the data objects to be
   time-stamped. In the case of CMS, two selection methods can be 
   distinguished:</t>
<list style="numbers">
   <t>The CMS Object as a whole including contentInfo is selected as
      data object and archive time-stamped. This means that a hash value
      of the CMS object must be located in the first list of hash values
      of Archive Time-Stamps.</t>

   <t>The CMS Object and the signed or encrypted content are included in
      the Archive Time-Stamp as separated objects. In this case the
      hash value of the CMS Object as well as the hash value of the
      content have to be stored in the first list of hash values as a
      group of data objects.</t>
</list>

   <t>However, other selection methods could also be applied like for
   instance in [RFC3126].</t>

   <t>In the case of the two selection methods defined above, the Evidence
   Record has to be added to the first signature
   of the CMS Object of signed data. Depending on the selection
   method, the following Object Identifier is defined for the Evidence
   Record:</t>
<figure><artwork>
   Internal signature:
   id-EvidenceRecord ::= {id-ATS-Attribute 1}
   External signature:
   id-EvidenceRecord ::= {id-ATS-Attribute 2}
</artwork></figure>

   <t>The attributes should only occur once. If they appear several times,
   they have to be stored within the first signature in a chronological
   order.</t>

   <t>If the CMS object doesn't have the EvidenceRecord 
   Attributes - which indicates that the EvidenceRecord has
   been provided externally - the archive time-stamped data object has 
   to be generated over the complete CMS object within the existing
   coding.</t>

   <t>In case of verification, if only one EvidenceRecord is contained 
   in the CMS object, the hash value must be generated over the CMS
   object without the one EvidenceRecord. This means that the attribute
   has to be removed before verification. The length of fields
   containing tags has to be adapted. Apart from that, the existing
   coding must not be modified. </t>

   <t>If several Archive Time-Stamps occur, the data object has to be 
   generated as follows: </t>
<list style="symbols">
   <t>During verification of the first (in a chronological order) 
    EvidenceRecord, all EvidenceRecord have to be removed in order to 
    generate the data object.</t>

   <t>During verification of the nth one EvidenceRecord, the first n-1 
     attributes should remain within the CMS object.</t>

   <t>The verification of the nth one EvidenceRecord must result in a 
     point of time when the document must have existed with the first n  
     attributes. The verification of the n+1th attribute must prove that
     this requirement has been met.</t>
</list>
    </section>
  </back>
</rfc>

