Documentation
¶
Index ¶
- Constants
- func ExtractCertificateTimestampFromLeaf(leafBytes []byte) (rfc6962.CertificateTimestamp, error)
- func ExtractSCTInputFromBundle(ebRaw []byte, N uint64) (rfc6962.CertificateTimestamp, error)
- func NewCertificateTimestamp(ext []byte, timestamp uint64, isPrecert bool, cert []byte, ikh [32]byte) *rfc6962.CertificateTimestamp
- func ParseCTExtensionsB64(ext string) (uint64, error)
- func ParseCTExtensionsBytes(ext []byte) (uint64, error)
- type Entry
- type EntryBundle
Constants ¶
const ( IssuersPrefix = "issuer/" IssuersContentType = "application/pkix-cert" )
Variables ¶
This section is empty.
Functions ¶
func ExtractCertificateTimestampFromLeaf ¶ added in v0.1.2
func ExtractCertificateTimestampFromLeaf(leafBytes []byte) (rfc6962.CertificateTimestamp, error)
ExtractCertificateTimestampFromLeaf parses a TLS-encoded MerkleTreeLeaf byte slice and returns the corresponding CertificateTimestamp.
func ExtractSCTInputFromBundle ¶ added in v0.1.2
func ExtractSCTInputFromBundle(ebRaw []byte, N uint64) (rfc6962.CertificateTimestamp, error)
ExtractSCTInputFromBundle extracts the SCT input fields of the Nth entry from the provided serialised entry bundle.
This implementation avoids unnecessary parsing and allocation by skipping over uninteresting bytes and ignoring extensions and fingerprints.
func NewCertificateTimestamp ¶ added in v0.1.2
func NewCertificateTimestamp(ext []byte, timestamp uint64, isPrecert bool, cert []byte, ikh [32]byte) *rfc6962.CertificateTimestamp
NewCertificateTimestamp creates an rfc6962.CertificateTimestamp with the provided RFC6962 CTExtensions byte slice.
func ParseCTExtensionsB64 ¶ added in v0.1.2
ParseCTExtensionsB64 parses base64-encoded CTExtensions into an index. Code is inspired by https://github.com/FiloSottile/sunlight/blob/main/tile.go.
func ParseCTExtensionsBytes ¶ added in v0.1.2
ParseCTExtensionsBytes parses binary CTExtensions into an index.
Types ¶
type Entry ¶
type Entry struct {
Timestamp uint64
IsPrecert bool
// Certificate holds different things depending on whether the entry represents a Certificate or a Precertificate submission:
// - IsPrecert == false: the bytes here are the x509 certificate submitted for logging.
// - IsPrecert == true: the bytes here are the TBS certificate extracted from the submitted precert.
Certificate []byte
// Precertificate holds the precertificate to be logged, only used when IsPrecert is true.
Precertificate []byte
IssuerKeyHash []byte
RawFingerprints string
FingerprintsChain [][32]byte
RawExtensions string
LeafIndex uint64
}
Entry represents a CT log entry.
func (*Entry) UnmarshalText ¶
UnmarshalText implements encoding/TextUnmarshaler and reads EntryBundles which are encoded using the Static CT API spec.
type EntryBundle ¶
type EntryBundle struct {
// Entries stores the leaf entries of the log, in order.
Entries [][]byte
}
EntryBundle represents a sequence of entries in the log. These entries correspond to a leaf tile in the hash tree.
func (*EntryBundle) UnmarshalText ¶
func (t *EntryBundle) UnmarshalText(raw []byte) error
UnmarshalText implements encoding/TextUnmarshaler and reads EntryBundles which are encoded using the Static CT API spec. TODO(phbnf): we can probably parse every individual leaf directly, since most callers of this method tend to do so.