Internet-Draft C509 Prefix Reproduction December 2026
Jones Expires 5 June 2027 [Page]
Workgroup:
Network Working Group
Published:
Intended Status:
Informational
Expires:
Author:
V. Jones
Entercation Info Inc.

Offline Reproduction of a C509 Certificate Prefix

Abstract

This individual Internet-Draft reproduces the first 42 octets of a published synthetic C509 certificate. It documents the semantic inputs, encoding procedure, comparison boundary, and limits of a field-level interoperability result.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 5 June 2027.

▲

Table of Contents

1. Scope

The source is the Type 2 certificate in Section 4.1 of [C509-VECTORS]. The test compares byte offsets 0 through 41, inclusive, using the CBOR rules in [RFC8949]. It checks the array header and fields 0 through 7. The public-key material, extensions, and signature are outside the comparison.

2. Input and Reproduction

The inputs in order are an eleven-member array header, type integer 2, a serial number byte string containing hexadecimal 1234, algorithm integer -256, a null issuer, two unsigned epoch-second values for 2025-01-02 and 2026-01-02 at 00:00:00 UTC, the 22 UTF-8 octets of selfsign-rsa-with-sha1, and public key algorithm integer 0. There is no string terminator.

Save the following as check.py and run python3 -I check.py. The program constructs the observed bytes from the semantic values before loading the comparison constant. The expected constant comes from the published plain hex. This is a reconstruction from a previously inspected public source.

from datetime import datetime, timezone

def epoch_field(year):
    seconds = int(datetime(year, 1, 2, tzinfo=timezone.utc).timestamp())
    return bytes([26]) + seconds.to_bytes(4, "big")

serial = bytes.fromhex("1234")
subject = b"selfsign-rsa-with-sha1"
assert len(subject) == 22
actual = (
    bytes([128 + 11, 2, 64 + len(serial)]) + serial
    + bytes([56, -1 - (-256), 246])
    + epoch_field(2025) + epoch_field(2026)
    + bytes([96 + len(subject)]) + subject + bytes([0])
)
print(actual.hex())
expected = bytes.fromhex(
    "8B0242123438FFF61A6775D7001A69570A807673656C667369676E2D7273612D7769"
    "74682D7368613100"
)
assert len(actual) == 42 and actual == expected
print("MATCH")

The observed result was MATCH. The subject occupies offsets 18 through 40, including its header. The integer 0 at offset 41 confirms the boundary under this comparison.

3. Interpretation

A report for this check can identify the source revision, section, range, expected bytes, observed bytes, and result. A verifier can preserve a successful result for that range while reporting signature verification, chain validation, and authorization as unassessed. A recipient's policy disposition is a separate finding.

The encoding comparison concerns a C509 certificate prefix. For COSE_Sign1, the signature input is a separate structure with the protected header byte string, external AAD, and payload under the Signature1 context, as specified in [RFC9052]. No COSE signature input is constructed here.

4. Security Considerations

The published fixture includes a legacy signature algorithm identifier. The match checks the encoding of the identifier. Algorithm acceptability, signature validity, signer identity, and certificate trust require separate checks. A prefix match alone leaves the unexamined bytes unconstrained. A verifier relying on an entire certificate needs full-object parsing and its applicable validation policy.

5. IANA Considerations

This document requests no IANA actions.

6. Informative References

[C509-VECTORS]
Liao, L., Selander, G., and J. Preuß Mattsson, "Test Vectors for CBOR-Encoded X.509 (C509) Certificates", Work in Progress, Internet-Draft, draft-ietf-cose-c509-test-vectors-05, , <https://datatracker.ietf.org/doc/html/draft-ietf-cose-c509-test-vectors-05>.
[RFC8949]
Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 8949, , <https://www.rfc-editor.org/rfc/rfc8949.html>.
[RFC9052]
Schaad, J., "CBOR Object Signing and Encryption (COSE): Structures and Process", RFC 9052, , <https://www.rfc-editor.org/rfc/rfc9052.html>.

Author's Address

Vince Jones
Entercation Info Inc.