RFC 6019
BinaryTime: An Alternate Format for Representing Date and Time in ASN.1
Abstract ๐
okay bestie, let's get into RFC 6019 โจ BinaryTime: An Alternate Format for Representing Date and Time in ASN.1. It's an Internet Standards Track doc by Russell Housley at Vigil Security (September 2010), and it obsoletes RFC 4049 ๐ฆ
This doc introduces a brand new ASN.1 type for time called BinaryTime ๐ฐ๏ธ It also gives you an alternative to the signing-time attribute for CMS SignedData and AuthenticatedData, called the binary-signing-time attribute, which uses BinaryTime. CMS and the signing-time attribute both come from RFC 5652 ๐
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 5741.
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6019.
Copyright Notice ๐ง
Copyright (c) 2010 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 (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
1. Introduction ๐
Okay so this doc specifies a new ASN.1 [ASN1] type for representing time, called BinaryTime ๐ฅฐ It can be used to represent date and time values, and that's literally the whole vibe.
It also specifies an alternative to the signing-time attribute used with the Cryptographic Message Syntax [CMS] SignedData and AuthenticatedData content types. This lets BinaryTime be used instead of the traditional UTCTime and GeneralizedTime types ๐ซถ
1.1. BinaryTime ๐ฆ
Many operating systems represent date and time as an integer, and this doc specifies an ASN.1 type that represents date and time in a way that is also an integer ๐ข Sometimes a bit of conversion is needed because of a different epoch or a different granularity, but an integer representation has several perks over UTCTime and GeneralizedTime.
First, a BinaryTime value is smaller than either a UTCTime or a GeneralizedTime value. Tiny and iconic ๐ค
Second, in some operating systems the value can be used with little or no conversion. When conversion is needed, it's just straightforward computation ๐งฎ If the endian ordering is different from the ASN.1 representation of an INTEGER, you need some straightforward manipulation to get an equivalent integer value. If the epoch is different from the one chosen for BinaryTime, you add or subtract to compensate. If the granularity is something other than seconds, you multiply or divide to compensate. And padding may be needed to turn the variable-length ASN.1 encoding of INTEGER into a fixed-length value that the operating system uses ๐
Third, date comparison is very easy with BinaryTime. Integer comparison is easy, even when multi-precision integers are involved. Comparing UTCTime or GeneralizedTime values can get messy when the two values are given in different time zones ๐๐
This is a rare instance in which both memory and processor cycles can be saved. Main character energy for real ๐
1.2. Binary Signing Time Attribute ๐
The signing-time attribute is defined in [CMS]. The alternative binary-signing-time attribute is defined in this document so that you get the benefits of the BinaryTime type โจ
1.3. Terminology ๐
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 RFC 2119 [STDWORDS] ๐ซก
2. BinaryTime Definition ๐
The BinaryTime ASN.1 type is used to represent an absolute time and date. A positive integer value is used to represent time values based on coordinated universal time (UTC), which is also called Greenwich Mean Time (GMT) and ZULU clock time โญ
The syntax for BinaryTime is:
BinaryTime ::= INTEGER (0..MAX)
The integer value is the number of seconds, excluding leap seconds, after midnight UTC, January 1, 1970. This representation of time is sometimes called "UNIX time" [POSIX]. This time format cannot represent time values prior to January 1, 1970. The latest UTC time value that can be represented by a four-octet integer value is 03:14:07 on January 19, 2038, which is represented by the hexadecimal value 7FFFFFFF. Time values beyond 03:14:07 on January 19, 2038, are represented by integer values that are longer than four octets, and a five-octet integer value is sufficient to represent dates covering the next seventeen millennia ๐ฅน Long-term planning, bestie.
This specification uses a variable-length encoding of INTEGER. This permits any time value after midnight UTC, January 1, 1970, to be represented ๐
When encoding an integer value that consists of more than one octet, which includes almost all the time values of interest, the bits of the first octet and bit 8 of the second octet MUST NOT all be ones or all zeros. This rule ensures that an integer value is always encoded in the smallest possible number of octets. However, it means that implementations cannot assume a fixed length for the integer value ๐ง
3. Binary Signing Time Attribute Definition ๐ง
The binary-signing-time attribute type specifies the time at which the signer (purportedly) performed the signing process. It's intended for use in the CMS SignedData content type, but the attribute can also be used with the AuthenticatedData content type ๐
The binary-signing-time attribute MUST be a signed attribute or an authenticated attribute. It MUST NOT be an unsigned attribute, unauthenticated attribute, or unprotected attribute ๐
The following object identifier identifies the binary-signing-time attribute:
id-aa-binarySigningTime OBJECT IDENTIFIER ::= { iso(1)
member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
smime(16) aa(2) 46 }
The binary-signing-time attribute values have ASN.1 type BinarySigningTime:
BinarySigningTime ::= BinaryTime
In [CMS], the SignedAttributes syntax and the AuthAttributes syntax are each defined as a SET OF Attributes. However, the binary-signing-time attribute MUST have a single attribute value, even though the syntax is defined as a SET OF AttributeValue. There MUST NOT be zero or multiple instances of AttributeValue present ๐ซต
The SignedAttributes contained in the signerInfo structure within SignedData MUST NOT include multiple instances of the binary-signing-time attribute. Similarly, the AuthAttributes in an AuthenticatedData MUST NOT include multiple instances of the binary-signing-time attribute ๐ โโ๏ธ
No requirement is imposed concerning the correctness of the signing time itself, and acceptance of a purported signing time is a matter of a recipient's discretion. It is expected, however, that some signers, such as time-stamp servers, will be trusted implicitly ๐ซง
4. Security Considerations ๐จ
โ ๏ธ Security note, bestie. This part is serious, so read it carefully.
Use of the binary-signing-time attribute does not necessarily provide confidence in the time when the signature value was produced. Therefore, acceptance of a purported signing time is a matter of a recipient's discretion. RFC 3161 [TSP] specifies a protocol for obtaining time stamps from a trusted entity ๐ต๏ธโโ๏ธ
The original signing-time attribute defined in [CMS] has the same semantics as the binary-signing-time attribute specified in this document. Therefore, only one of these attributes SHOULD be present in the signedAttrs of a SignerInfo object or in the authAttrs of an AuthenticatedData object. However, if both of these attributes are present, they MUST provide the same date and time ๐ฅบ
5. References ๐
5.1. Normative References
[ASN1]CCITT. Recommendation X.208: Specification of Abstract Syntax Notation One (ASN.1). 1988.[CMS]Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, September 2009.[STDWORDS]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
5.2. Informative References
[POSIX]Institute of Electrical and Electronics Engineers. IEEE P1003.1, Information Technology Portable Operating System Interface (POSIX) Part 1: System Application Program Interface (API) [C Language], 1990.[TSP]Adams, C., Cain, P., Pinkas, D., and R. Zuccherato, "Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)", RFC 3161, August 2001.
Appendix A: ASN.1 Module ๐งฉ
The ASN.1 module in this appendix defines the structures needed to implement this specification. It's expected to be used together with the ASN.1 modules in [CMS] ๐
BinarySigningTimeModule
{ iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
pkcs-9(9) smime(16) modules(0) 27 }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
-- BinaryTime Definition
BinaryTime ::= INTEGER (0..MAX)
-- Signing Binary Time Attribute
id-aa-binarySigningTime OBJECT IDENTIFIER ::= { iso(1)
member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
smime(16) aa(2) 46 }
BinarySigningTime ::= BinaryTime
END
Author's Address ๐
Russell Housley Vigil Security, LLC 918 Spring Knoll Drive Herndon, VA 20170 USA
EMail: housley@vigilsec.com
๐๐โจ bestie, that's the whole thing ๐ฆ literally iconic ๐
๐ฆ where this page comes from
- ietf: rfc6019 2010-09
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms