RFC 9921: CBOR Object Signing and Encryption (COSE) Header Parameter for Timestamp Tokens as Defined in RFC 3161
- H. Birkholz,
- T. Fossati,
- M. Riechert
Abstract
This document defines two CBOR Object Signing and Encryption (COSE) header parameters for incorporating timestamping based on RFC 3161 into COSE message structures (COSE_Sign and COSE_Sign1).
This enables the use of established timestamping infrastructure per RFC 3161 in COSE-based protocols.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
RFC 3161 [RFC3161] provides a method for timestamping a message digest to prove that it was created before a given time.¶
This document defines two new CBOR Object Signing and Encryption (COSE) [RFC9052] header parameters that carry the TimeStampToken (TST) output [RFC3161], thus allowing existing and widely deployed trust infrastructure to be used with COSE structures used for signing (COSE_Sign and COSE_Sign1).¶
1.1. Use Cases
This section discusses two use cases, each representing one of the two modes of use defined in Section 2.
As the security characteristics of the two cases differ, care must be taken when choosing the appropriate mode for a given application.
See Section 5.1 for a discussion on the security of the implementations
The primary use case is that of "long-term signatures", i.e., signatures that can still be verified even after the signing certificate has expired. This can address situations where it is important to prevent subsequent denial by the signer or to verify signatures made using (very) short-term certificates. To achieve this, the document signer acquires a fresh TST for the document's signature from a trusted Time Stamping Authority (TSA) [RFC3161] and concatenates it with the document. Later, when a relying party verifies the signed document and its associated TST, they can be certain that the document was signed at least at the time specified by the TSA and that the signing certificate was valid at the time the signature was made.¶
This primary usage scenario motivates the "COSE, Then Timestamp" mode described in Section 2.1.¶
The second use case is new. It is the notarization of a signed document by registering it with a transparency service. This is common practice for ensuring the accountability and auditability of issued documents, which are typically referred to as "statements" in this context. It is also common practice to only register the signed parts of a statement (the "signed statement" portion) with a transparency service, in order to reduce the complexity of consistency checks at a later stage and to avoid the need to retrieve or reconstruct unsigned parts. Once the signed parts of a document have been registered in the append-only log at a transparency service, the log entry cannot be changed. In order to avoid losing the TST during the registration process, the TST must be included in the signed statement. To achieve this, the issuer acquires a TST from a TSA, includes it in the to-be-signed part of the statement so that the resulting signed statement includes the TST, and then registers the signed parts (rendering it a "transparent statement"). Later on, a relying party consuming the transparent statement including the TST can be certain that the statement was signed by the issuer at least at the time specified by the TSA. If the issuer's signing key has expired (or has been compromised), the authenticity of the statement can be ascertained by ensuring that no revocation information was made public before the time asserted by the issuer and registered at the transparency service.¶
This new usage scenario motivates the "Timestamp, Then COSE" mode defined in Section 2.2.¶
1.2. 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.¶
2. Modes of Use
There are two different modes of composing COSE protection and timestamping, motivated by the usage scenarios discussed above.¶
The diagrams in this section illustrate the processing flow of the specified modes.
For simplicity, only the COSE_Sign1 processing is shown.
Similar diagrams for COSE_Sign can be derived by allowing multiple private-key parallelogram boxes and replacing the label [signature] with [signatures].¶
2.1. COSE, Then Timestamp (CTT)
Figure 1 shows the case where the signature(s) field of the COSE Signed Message 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.¶
This mode is utilized when a record of the timing of the signature operation is desired.¶
In this context, timestamp tokens are similar to a countersignatur
3. Timestamp Tokens per RFC 3161: COSE Header Parameters
The two modes described in Sections 2.2 and 2.1 use different inputs into the timestamping machinery and consequently create different kinds of bindings between COSE and TST. To clearly separate their semantics, two different COSE header parameters are defined as described in the following subsections.¶
3.1. 3161-ctt
The 3161-ctt COSE unprotected header parameter MUST be used for the mode described in Section 2.1.¶
The 3161-ctt unprotected header parameter contains a DER-encoded TST [RFC3161] wrapped in a CBOR byte string (Major type 2).¶
The MessageImprint sent in the request to the TSA MUST be¶
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.¶
Refer to Sections 3.1.1 and 3.1.2 for concrete examples of MessageImprint computation.¶
3.1.1. MessageImprint Computation for COSE_Sign1
The following illustrates how MessageImprint is computed using a sample COSE_Sign1 message.¶
Given the COSE_Sign1 message¶
the bstr-wrapped signature¶
(including the heading bytes 0x5840) is used as input for computing the MessageImprint.¶
When using SHA-256, the resulting MessageImprint is¶
3.2. 3161-ttc
The 3161-ttc COSE protected header parameter MUST be used for the mode described in Section 2.2.¶
The 3161-ttc protected header parameter contains a DER-encoded TST [RFC3161] wrapped in a CBOR byte string (Major type 2).¶
The MessageImprint sent to the TSA (Section 2.4 of [RFC3161]) MUST be the hash of the payload of the COSE Signed Message.
This does not include the bstr wrapping -- only the payload bytes.
(For an example, see Appendix A.1.)¶
To minimize dependencies, the hash algorithm used for signing the COSE message SHOULD be the same as the algorithm used in the MessageImprint [RFC3161].
However, this may not be possible if the timestamp requester and the COSE message signer are different entities.¶
4. Timestamp Processing
Timestamp tokens [RFC3161] use Cryptographic Message Syntax (CMS) as the signature envelope format.
[RFC5652] provides details about signature verification, and [RFC3161] provides details specific to timestamp token validation.
The payload of the signed timestamp token is the TSTInfo structure defined in [RFC3161], which contains the MessageImprint that was sent to the TSA.
The hash algorithm is contained in the MessageImprint structure, together with the hash itself.¶
As part of the signature verification, the receiver MUST make sure that the MessageImprint in the embedded timestamp token matches a hash of either the payload, signature, or signature fields, depending on the mode of use and type of COSE structure.¶
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.¶
5. Security Considerations
Please review the Security Considerations section in [RFC3161]; these considerations apply to this document as well.¶
Also review the Security Considerations section in [RFC9052]. These considerations apply to this document as well, particularly with regard to the need for implementations to protect private key material. Additionally, solutions based on the COSE header parameters defined in this document must be able to report compromised keys promptly.¶
The following scenario assumes that an attacker can manipulate the clocks on the COSE signer and its relying parties, but not the TSA. It is also assumed that the TSA is a trusted third party, so the attacker cannot impersonate the TSA and create valid timestamp tokens. In such a setting, any tampering with the COSE signer's clock does not have an impact, because once the timestamp is obtained from the TSA, it becomes the only reliable source of time. However, in both CTT mode and TTC mode, a denial of service can occur if the attacker can adjust the relying party's clock so that the CMS validation fails. This could disrupt the timestamp validation.¶
In CTT mode, an attacker could manipulate the unprotected header by removing or replacing the timestamp. To avoid that, the COSE Signed Message should be integrity protected during transit and at rest.¶
In TTC mode, the TSA is given an opaque identifier (a cryptographic hash value) for the payload. While this means that the content of the payload is not directly revealed, to prevent comparison with known payloads or disclosure of identical payloads being used over time, the payload would need to be armored, e.g., with a nonce that is shared with the recipient of the header parameter but not the TSA. Such a mechanism is out of scope for this document.¶
The resolution, accuracy, and precision of the TSA clock, as well as the expected latency introduced by round trips to and from the TSA, must be taken into account when implementing solutions based on the COSE header parameters defined in this document.¶
5.1. Avoiding Semantic Confusion
CTT mode and TTC mode have different semantic meanings. An implementation must ensure that the contents of the CTT and TTC headers are interpreted according to their specific semantics. In particular, symmetric to the signature and assembly mechanics, each mode has its own separate verification algorithm.¶
Implementers MUST clearly differentiate between TSA timestamps [RFC3161] proving the existence of payload data at an earlier point in time (TTC) and timestamps explicitly providing evidence of the existence of the cryptographic signature (CTT).
Failure to clearly distinguish between these timestamp semantics can result in vulnerabilities
6. IANA Considerations
IANA has allocated the COSE header parameters defined in Table 1 in the "COSE Header Parameters" registry [IANA
7. Normative References
- [IANA
.cose _header -parameters] -
IANA, "COSE Header Parameters", <https://
www >..iana .org /assignments /cose - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC3161]
-
Adams, C., Cain, P., Pinkas, D., and R. Zuccherato, "Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)", RFC 3161, DOI 10
.17487 , , <https:///RFC3161 www >..rfc -editor .org /info /rfc3161 - [RFC5652]
-
Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, DOI 10
.17487 , , <https:///RFC5652 www >..rfc -editor .org /info /rfc5652 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC9052]
-
Schaad, J., "CBOR Object Signing and Encryption (COSE): Structures and Process", STD 96, RFC 9052, DOI 10
.17487 , , <https:///RFC9052 www >..rfc -editor .org /info /rfc9052
Appendix A. Examples
A.1. TTC
The payload¶
is hashed using SHA-256 to create the following TimeStampReq object¶
which is sent to the TSA.¶
A TimeStampResp containing the following TST is returned:¶
The contents of the TST are bstr-wrapped and added to the protected headers bucket, which is then signed alongside the original payload to obtain the COSE_Sign1 object.¶
A.2. CTT
Starting with the following COSE_Sign1 object,¶
the CBOR-encoded signature field is hashed using SHA-256 to create the following TimeStampReq object¶
which is sent to the TSA.¶
A TimeStampResp containing the following TST is returned:¶
The contents of the TST are bstr-wrapped and added to the unprotected headers bucket in the original COSE_Sign1 object to obtain the following:¶
Acknowledgments
The authors would like to thank Alexey Melnikov, Carl Wallace, Carsten Bormann, Deb Cooley, Éric Vyncke, Francesca Palombini, Leonard Rosenthol, Linda Dunbar, Michael B. Jones, Michael Prorock, Mike Bishop, Mohamed Boucadair, Orie Steele, Roman Danyliw, Shuping Peng, Stefan Santesson, Steve Lasker, and Yingzhen Qu for their reviews and comments.¶
Contributors
Carsten contributed part of the security considerations.¶
Orie contributed an improved version of the diagrams.¶