proof

package
v0.20261110.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package proof implements the MTCProof and Cosignature types from https://ietf-plants-wg.github.io/merkle-tree-certs/draft-ietf-plants-merkle-tree-certs.html#name-certificate-format.

These are used to generate the signature field of MTCs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SigAlgEncoded

func SigAlgEncoded() []byte

SigAlgEncoded returns a DER-encoded AlgorithmIdentifier suitable for use with MTCProof signatures. Currently it returns 1.3.6.1.5.5.7.6.67, per https://ietf-plants-wg.github.io/merkle-tree-certs/draft-ietf-plants-merkle-tree-certs.html#name-certificate-format.

AlgorithmIdentifier is encoded per https://www.rfc-editor.org/info/rfc5280/#section-4.1.1.2:

AlgorithmIdentifier  ::=  SEQUENCE  {
     algorithm               OBJECT IDENTIFIER,
     parameters              ANY DEFINED BY algorithm OPTIONAL  }

Types

type Cosignature added in v0.20261105.0

type Cosignature struct {
	CosignerID []byte
	Signature  []byte
}

Cosignature represents the struct of that name in https://ietf-plants-wg.github.io/merkle-tree-certs/draft-ietf-plants-merkle-tree-certs.html#name-certificate-format.

Standalone certificates carry two or more of these in addition to their inclusion proof. Landmark-relative certificates carry none.

/* From Section 4 of draft-ietf-tls-trust-anchor-ids */ opaque TrustAnchorID<1..2^8-1>;

struct {
    TrustAnchorID cosigner_id;
    opaque signature<0..2^16-1>;
} Cosignature;

func (*Cosignature) Marshal added in v0.20261105.0

func (ms *Cosignature) Marshal() ([]byte, error)

Marshal serializes the bytes of a Cosignature.

type MTCProof

type MTCProof struct {
	Extensions     []byte
	Start, End     int64
	InclusionProof []tlog.Hash
	Signatures     []*Cosignature
}

MTCProof represents the MTCProof structure from https://ietf-plants-wg.github.io/merkle-tree-certs/draft-ietf-plants-merkle-tree-certs.html#name-certificate-format

struct {
    MTCLogEntryExtension extensions<0..2^16-1>;
    uint48 start;
    uint48 end;
    opaque inclusion_proof<0..2^16-1>;
    Cosignature signatures<0..2^24-1>;
} MTCProof;

func UnmarshalMTCProof

func UnmarshalMTCProof(in []byte) (*MTCProof, error)

UnmarshalMTCProof parses the MTCProof structure from https://ietf-plants-wg.github.io/merkle-tree-certs/draft-ietf-plants-merkle-tree-certs.html#certificate-format.

The returned structure will have slices that point to the input data.

func (*MTCProof) Marshal

func (m *MTCProof) Marshal() ([]byte, error)

Marshal serializes the bytes of an MTCProof.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL