2626
2727from pydantic import BaseModel , Field , StrictStr
2828
29- from sigstore ._internal .rekor .client import RekorClient
30- from sigstore ._internal .trustroot import KeyringSignatureError
29+ from sigstore ._internal .trustroot import KeyringSignatureError , RekorKeyring
3130from sigstore ._utils import KeyID
3231from sigstore .transparency import LogEntry
3332
@@ -163,7 +162,7 @@ def from_text(cls, text: str) -> SignedNote:
163162
164163 return cls (note = header , signatures = signatures )
165164
166- def verify (self , client : RekorClient , key_id : KeyID ) -> None :
165+ def verify (self , rekor_keyring : RekorKeyring , key_id : KeyID ) -> None :
167166 """
168167 Verify the `SignedNote` with using the given RekorClient by verifying each contained signature.
169168 """
@@ -175,7 +174,7 @@ def verify(self, client: RekorClient, key_id: KeyID) -> None:
175174 raise CheckpointError ("sig_hash hint does not match expected key_id" )
176175
177176 try :
178- client . _rekor_keyring .verify (
177+ rekor_keyring .verify (
179178 key_id = key_id , signature = base64 .b64decode (sig .signature ), data = note
180179 )
181180 except KeyringSignatureError as sig_err :
@@ -202,7 +201,7 @@ def from_text(cls, text: str) -> SignedCheckpoint:
202201 return cls (signed_note = signed_note , checkpoint = checkpoint )
203202
204203
205- def verify_checkpoint (client : RekorClient , entry : LogEntry ) -> None :
204+ def verify_checkpoint (rekor_keyring : RekorKeyring , entry : LogEntry ) -> None :
206205 """
207206 Verify the inclusion proof's checkpoint.
208207 """
@@ -215,7 +214,9 @@ def verify_checkpoint(client: RekorClient, entry: LogEntry) -> None:
215214 # 1) verify the signature on the checkpoint
216215 # 2) verify the root hash in the checkpoint matches the root hash from the inclusion proof.
217216 signed_checkpoint = SignedCheckpoint .from_text (inclusion_proof .checkpoint )
218- signed_checkpoint .signed_note .verify (client , KeyID (bytes .fromhex (entry .log_id )))
217+ signed_checkpoint .signed_note .verify (
218+ rekor_keyring , KeyID (bytes .fromhex (entry .log_id ))
219+ )
219220
220221 checkpoint_hash = signed_checkpoint .checkpoint .log_hash
221222 root_hash = inclusion_proof .root_hash
0 commit comments