Skip to content

Commit 1973a27

Browse files
authored
[Docs] Better docs for CT functions (#267)
Renamed Sunlight to Static CT, and added pointers to the RFC 6962 to Checkpoint conversion
1 parent 1b59996 commit 1973a27

5 files changed

Lines changed: 20 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ provided in the respective directories:
2424
The [`log checkpoint`](./log/README.md#checkpoint-format) represents a commitment to the
2525
state of a transparent log.
2626

27+
### RFC 6962 / Certificate Transparency Interoperability
28+
29+
For interoperability with classic RFC 6962 logs, the [`note`](./note) package provides tools to convert Signed Tree Heads (STHs) to the checkpoint format and verify their signatures. See [`note_rfc6962.go`](./note/note_rfc6962.go) for details.
30+
2731
## Support
2832
* Mailing list: https://groups.google.com/forum/#!forum/trillian-transparency
2933
- Slack: https://transparency-dev.slack.com/ ([invitation](https://transparency.dev/slack/))

log/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ If you plan to use `otherdata` in your log, see the section on [merging checkpoi
8686
The first signature on a checkpoint should be from the log which issued it, but there MUST NOT
8787
be more than one signature from a log identity present on the checkpoint.
8888

89+
## RFC 6962 (Certificate Transparency) Interoperability
90+
91+
If you need to work with classic RFC 6962 CT logs, you can convert their JSON Signed Tree Heads (STHs) to this checkpoint format.
92+
93+
The conversion and verification tools are located in the [`note`](../note) package:
94+
* [`note.RFC6962STHToCheckpoint`](../note/note_rfc6962.go) converts an STH to a signed checkpoint.
95+
* [`note.NewRFC6962Verifier`](../note/note_rfc6962.go) creates a verifier for these checkpoint signatures.
96+
8997
## Example
9098

9199
An annotated example signed checkpoint in this format is shown below:

log/checkpoint.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
// Package log provides basic support for the common log checkpoint and proof
1616
// format described by the README in this directory.
17+
//
18+
// For converting classic RFC 6962 Signed Tree Heads (STH) to this checkpoint
19+
// format, see note.RFC6962STHToCheckpoint in the github.com/transparency-dev/formats/note package.
1720
package log
1821

1922
import (

note/note_rfc6962.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func RFC6962VerifierString(logURL string, pubK crypto.PublicKey) (string, error)
4848
return fmt.Sprintf("%s+%08x+%s", name, hash, base64.StdEncoding.EncodeToString(append([]byte{algRFC6962STH}, pubSer...))), nil
4949
}
5050

51-
// NewRFC6962Verifier creates a note verifier for Sunlight/RFC6962 checkpoint signatures.
51+
// NewRFC6962Verifier creates a note verifier for Static CT/RFC6962 checkpoint signatures.
5252
func NewRFC6962Verifier(vkey string) (note.Verifier, error) {
5353
name, vkey, _ := strings.Cut(vkey, "+")
5454
hash16, key64, _ := strings.Cut(vkey, "+")
@@ -90,7 +90,7 @@ type signedTreeHead struct {
9090
}
9191

9292
// RFC6962STHToCheckpoint converts the provided RFC6962 JSON representation of a CT Signed Tree Head structure to
93-
// a sunlight style signed checkpoint.
93+
// a Static CT style signed checkpoint.
9494
// The passed in verifier must be an RFC6929Verifier containing the correct details for the log which signed the STH.
9595
func RFC6962STHToCheckpoint(j []byte, v note.Verifier) ([]byte, error) {
9696
var sth signedTreeHead
@@ -134,11 +134,11 @@ func rfc6962Keyhash(name string, logID [32]byte) uint32 {
134134
return binary.BigEndian.Uint32(r)
135135
}
136136

137-
// rfc6962LogName returns a sunlight checkpoint compatible log name from the
137+
// rfc6962LogName returns a Static CT checkpoint compatible log name from the
138138
// passed in CT log root URL.
139139
//
140140
// "For example, a log with submission prefix https://rome.ct.example.com/2024h1/ will use rome.ct.example.com/2024h1 as the checkpoint origin line"
141-
// (see https://github.com/C2SP/C2SP/blob/main/sunlight.md#checkpoints)
141+
// (see https://github.com/C2SP/C2SP/blob/main/static-ct-api.md#checkpoints)
142142
func rfc6962LogName(logURL string) string {
143143
logURL = strings.ToLower(logURL)
144144
logURL = strings.TrimPrefix(logURL, "http://")

note/note_verifier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestNewVerifier(t *testing.T) {
8282
name: "ECDSA works",
8383
key: sigStoreKey,
8484
}, {
85-
name: "Sunlight works",
85+
name: "Static CT works",
8686
key: "ct.googleapis.com/logs/us1/argon2024+7deb49d0+BTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABB25bKnLaZTFXOa2pgO70rjcVEMXKJkMBgFQHZ1kwFlGK9zIAx0FtC2oCfeZQe0E++VXuiYE9hFSzhRlOy92K8A=",
8787
},
8888
} {

0 commit comments

Comments
 (0)