@@ -25,7 +25,6 @@ import (
2525 "time"
2626
2727 "github.com/google/trillian"
28- "github.com/google/trillian/client"
2928 radix "github.com/mediocregopher/radix/v4"
3029 "github.com/pkg/errors"
3130 "github.com/spf13/viper"
@@ -61,7 +60,6 @@ type API struct {
6160 tsaSigner signature.Signer // the signer to use for timestamping
6261 certChain []* x509.Certificate // timestamping cert chain
6362 certChainPem string // PEM encoded timestamping cert chain
64- verifier * client.LogVerifier
6563}
6664
6765func NewAPI () (* API , error ) {
@@ -85,13 +83,6 @@ func NewAPI() (*API, error) {
8583 tLogID = t .TreeId
8684 }
8785
88- t , err := logAdminClient .GetTree (ctx , & trillian.GetTreeRequest {
89- TreeId : tLogID ,
90- })
91- if err != nil {
92- return nil , errors .Wrap (err , "get tree" )
93- }
94-
9586 rekorSigner , err := signer .New (ctx , viper .GetString ("rekor_server.signer" ))
9687 if err != nil {
9788 return nil , errors .Wrap (err , "getting new signer" )
@@ -108,11 +99,6 @@ func NewAPI() (*API, error) {
10899
109100 pubkey := cryptoutils .PEMEncode (cryptoutils .PublicKeyPEMType , b )
110101
111- verifier , err := client .NewLogVerifierFromTree (t )
112- if err != nil {
113- return nil , errors .Wrap (err , "new verifier" )
114- }
115-
116102 // Use an in-memory key for timestamping
117103 tsaSigner , err := signer .New (ctx , signer .MemoryScheme )
118104 if err != nil {
@@ -146,15 +132,17 @@ func NewAPI() (*API, error) {
146132 }
147133
148134 return & API {
149- logClient : logClient ,
150- logID : tLogID ,
151- pubkey : string (pubkey ),
152- pubkeyHash : hex .EncodeToString (pubkeyHashBytes [:]),
153- signer : rekorSigner ,
135+ // Transparency Log Stuff
136+ logClient : logClient ,
137+ logID : tLogID ,
138+ // Signing/verifying fields
139+ pubkey : string (pubkey ),
140+ pubkeyHash : hex .EncodeToString (pubkeyHashBytes [:]),
141+ signer : rekorSigner ,
142+ // TSA signing stuff
154143 tsaSigner : tsaSigner ,
155144 certChain : certChain ,
156145 certChainPem : string (certChainPem ),
157- verifier : verifier ,
158146 }, nil
159147}
160148
0 commit comments