COSE Header parameter for RFC 3161 Time-Stamp Tokens
Internet-Draft draft-ietf-cose-tsa-tst-header-parameter-02
Henk Birkholz
Fraunhofer SIT
Rheinstrasse 75
Darmstadt
64295
Germany
henk.birkholz@sit.fraunhofer.de
Thomas Fossati
Linaro
thomas.fossati@linaro.org
Maik Riechert
Microsoft
UK
Maik.Riechert@microsoft.com
24 February 2024
Security
COSE
Internet-Draft
RFC 3161 provides a method for timestamping a message digest to prove that the message was created before a given time. This document defines a CBOR Signing And Encrypted (COSE) header parameter that can be used to combine COSE message structures used for signing (i.e., COSE_Sign and COSE_Sign1) with existing RFC 3161-based timestamping infrastructure.
Discussion Venues
Source for this draft and an issue tracker can be found at https://github.com/ietf-scitt/draft-birkholz-cose-tsa-tst-header-parameter.
Introduction
RFC 3161 [RFC3161] provides a method to timestamp a message digest to prove that it was created before a given time.
This document defines a new COSE [STD96] header parameter that carries the TimestampToken (TST) output of RFC 3161, thus allowing existing and widely deployed trust infrastructure to be used with COSE structures used for signing (COSE_Sign and COSE_Sign1).
Requirements Notation
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Modes of use
There are two different modes of composing COSE protection and timestamping.
Timestamp then COSE (TTC)
Figure 1 shows the case where a datum is first digested and submitted to a TSA to be timestamped.
A signed COSE message is then built as follows:
- The obtained timestamp token is added to the protected headers,
- The original datum becomes the payload of the signed COSE message.
Timestamp, then COSE (TTC)

payload

Sig_structure

COSE_Sign/COSE_Sign1

TSA

TST

.---------.              .---------------.     .----------------------.
| payload +------------->| Sig_structure +---->| COSE_Sign/COSE_Sign1 |
'----+----'              '---------------'     '----------------------'
     |                          ^
     |     .---.                |
     |    |     |     .-----.   |
     '--->| TSA +---->| TST +---'
          |     |     '-----'
           '---'

The message imprint sent to the TSA (Section 2.4 of [RFC3161]) MUST be the hash of the payload field of the COSE signed object.
COSE then Timestamp (CTT)
Figure 2 shows the case where the signature(s) field of the signed COSE object is digested and submitted to a TSA to be timestamped. The obtained timestamp token is then added back as an unprotected header into the same COSE object.
COSE, then Timestamp (CTT)

COSE_Sign/COSE_Sign1

TST

signatures/signature

TSA

.----------------------.         .-----.
| COSE_Sign/COSE_Sign1 |<--------+ TST |
'----+-----------------'         '-----'
     |                              ^
     v                              |
.----------------------.            |
| signatures/signature |            |
'----+-----------------'            |
     |                     .---.    |
     |                    |     |   |
     '------------------->| TSA +---'
                          |     |
                           '---'

In this context, timestamp tokens are similar to a countersignature [RFC9338] made by the TSA.
RFC 3161 Time-Stamp Tokens COSE Header Parameters
The two modes described in Section 2.1 and Section 2.2 use different inputs into the timestamping machinery, and consequently create different kinds of binding between COSE and TST. To clearly separate their semantics two different COSE header parameters are defined as described in the following subsections.
3161-ttc
The 3161-ttc COSE protected header parameter MUST be used for the mode described in Section 2.1.
The 3161-ttc protected header is defined as follows:
- Name: 3161-ttc
- Label: TBD
- Value Type: bstr
- Value Registry: [IANA.cose]
- Description: RFC 3161 timestamp token
- Reference: Section 3.1 of RFCthis
The content of the byte string are the bytes of the DER-encoded RFC 3161 TimeStampToken structure.
3161-ctt
The 3161-ctt COSE unprotected header parameter MUST be used for the mode described in Section 2.2.
The message imprint sent in the request to the TSA MUST be either:
- the hash of the signature field of the COSE_Sign1 message.
- the hash of the signatures field of the COSE_Sign message.
In either case, to minimize dependencies, the hash algorithm SHOULD be the same as the algorithm used for signing the COSE message. This may not be possible if the timestamp token has been obtained outside the processing context in which the COSE object is assembled.
The 3161-ctt unprotected header is defined as follows:
- Name: 3161-ctt
- Label: TBD
- Value Type: bstr
- Value Registry: [IANA.cose]
- Description: RFC 3161 timestamp token
- Reference: Section 3.2 of RFCthis
Timestamp Processing
RFC 3161 timestamp tokens use CMS as signature envelope format. [STD70] provides the details about signature verification, and [RFC3161] provides the details specific to timestamp token validation. The payload of the signed timestamp token is the TSTInfo structure defined in [RFC3161], which contains the message imprint that was sent to the TSA. The hash algorithm is contained in the message imprint structure, together with the hash itself.
As part of the signature verification, the receiver MUST make sure that the message imprint in the embedded timestamp token matches either the payload or the signature fields, depending on the mode of use.
Appendix B of [RFC3161] provides an example that illustrates how timestamp tokens can be used to verify signatures of a timestamped message when utilizing X.509 certificates.
Security Considerations
The security considerations made in [RFC3161] as well as those of [RFC9338] apply.
IANA Considerations
IANA is requested to add the two COSE header parameters described in Section 3 to the "COSE Header Parameters" subregistry of the [IANA.cose] registry.
References
Normative References
[STD70]

Cryptographic Message Syntax (CMS)
R. Housley
September 2009
STD 70
RFC 5652
DOI 10.17487/RFC5652
[RFC3161]

Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)
C. Adams
P. Cain
D. Pinkas
R. Zuccherato
August 2001
RFC 3161
DOI 10.17487/RFC3161
[STD96]

CBOR Object Signing and Encryption (COSE): Structures and Process
J. Schaad
August 2022
STD 96
RFC 9052
DOI 10.17487/RFC9052
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
[IANA.cose]

CBOR Object Signing and Encryption (COSE)
IANA
Informative References
[RFC9338]

CBOR Object Signing and Encryption (COSE): Countersignatures
J. Schaad
December 2022
STD 96
RFC 9338
DOI 10.17487/RFC9338