mozilla-services / pkcs7

DEPRECATED - Implements a subset of PKCS#7/Cryptographic Message Syntax (rfc2315, rfc5652)
https://go.mozilla.org/pkcs7
MIT License
70 stars 92 forks source link

SetContentType of SignedData #72

Closed vanbroup closed 9 months ago

vanbroup commented 2 years ago

Setting the content type of signed data is required to create an RFC3161 compliant timestamp response:

https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2

A TimeStampToken is as follows. It is defined as a ContentInfo ([CMS]) and SHALL encapsulate a signed data content type.

TimeStampToken ::= ContentInfo -- contentType is id-signedData ([CMS]) -- content is SignedData ([CMS])

The fields of type EncapsulatedContentInfo of the SignedData construct have the following meanings:

eContentType is an object identifier that uniquely specifies the content type. For a time-stamp token it is defined as:

id-ct-TSTInfo OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1) 4}