<?xml version="1.0" encoding="UTF-8"?>
<rfc version="3" ipr="trust200902" category="info" submissionType="IETF" docName="draft-jones-c509-prefix-reproduction-00">
<front>
<title abbrev="C509 Prefix Reproduction">Offline Reproduction of a C509 Certificate Prefix</title>
<author fullname="Vince Jones" initials="V." surname="Jones"><organization>Entercation Info Inc.</organization><address><email>vince@entercation.info</email></address></author>
<date year="2026" month="December" day="2"/>
<abstract><t>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.</t></abstract>
</front>
<middle>
<section><name>Scope</name><t>The source is the Type 2 certificate in Section 4.1 of <xref target="C509-VECTORS"/>. The test compares byte offsets 0 through 41, inclusive, using the CBOR rules in <xref target="RFC8949"/>. It checks the array header and fields 0 through 7. The public-key material, extensions, and signature are outside the comparison.</t></section>
<section><name>Input and Reproduction</name>
<t>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.</t>
<t>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.</t>
<sourcecode type="python">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")
</sourcecode>
<t>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.</t>
</section>
<section><name>Interpretation</name>
<t>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.</t>
<t>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 <xref target="RFC9052"/>. No COSE signature input is constructed here.</t></section>
<section><name>Security Considerations</name><t>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.</t></section>
<section><name>IANA Considerations</name><t>This document requests no IANA actions.</t></section>
</middle>
<back><references><name>Informative References</name>
<reference anchor="C509-VECTORS" target="https://datatracker.ietf.org/doc/html/draft-ietf-cose-c509-test-vectors-05"><front><title>Test Vectors for CBOR-Encoded X.509 (C509) Certificates</title><author fullname="Lijun Liao" initials="L." surname="Liao"/><author fullname="Göran Selander" initials="G." surname="Selander"/><author fullname="John Preuß Mattsson" initials="J." surname="Preuß Mattsson"/><date year="2026" month="November"/></front><seriesInfo name="Internet-Draft" value="draft-ietf-cose-c509-test-vectors-05"/></reference>
<reference anchor="RFC8949" target="https://www.rfc-editor.org/rfc/rfc8949.html"><front><title>Concise Binary Object Representation (CBOR)</title><author fullname="Carsten Bormann" initials="C." surname="Bormann"/><author fullname="Paul Hoffman" initials="P." surname="Hoffman"/><date year="2020" month="December"/></front><seriesInfo name="RFC" value="8949"/></reference>
<reference anchor="RFC9052" target="https://www.rfc-editor.org/rfc/rfc9052.html"><front><title>CBOR Object Signing and Encryption (COSE): Structures and Process</title><author fullname="Jim Schaad" initials="J." surname="Schaad"/><date year="2022" month="August"/></front><seriesInfo name="RFC" value="9052"/></reference>
</references></back></rfc>
