|
27 | 27 | from cryptography.x509 import Certificate
|
28 | 28 |
|
29 | 29 | from sigstore._internal import USER_AGENT
|
30 |
| -from sigstore._internal.rekor.v2_types.dev.sigstore.common.v1 import PublicKeyDetails |
| 30 | +from sigstore._internal.rekor.v2_types.dev.sigstore.common import v1 as common_v1 |
31 | 31 | from sigstore._internal.rekor.v2_types.dev.sigstore.rekor import v2
|
32 | 32 | from sigstore._internal.rekor.v2_types.io import intoto as v2_intoto
|
33 | 33 | from sigstore.dsse import Envelope
|
|
39 | 39 | DEFAULT_REKOR_URL = "https://rekor.sigstore.dev"
|
40 | 40 | STAGING_REKOR_URL = "https://rekor.sigstage.dev"
|
41 | 41 |
|
42 |
| -DEFAULT_KEY_DETAILS = PublicKeyDetails.PKIX_ECDSA_P384_SHA_256 |
| 42 | +DEFAULT_KEY_DETAILS = common_v1.PublicKeyDetails.PKIX_ECDSA_P384_SHA_256 |
43 | 43 |
|
44 | 44 |
|
45 | 45 | class RekorV2Client:
|
@@ -98,18 +98,17 @@ def _build_hashed_rekord_create_entry_request(
|
98 | 98 | cls,
|
99 | 99 | artifact_hashed_input: Hashed,
|
100 | 100 | artifact_signature: bytes,
|
101 |
| - signining_certificate: Certificate, |
| 101 | + signing_certificate: Certificate, |
102 | 102 | ) -> v2.CreateEntryRequest:
|
103 | 103 | return v2.CreateEntryRequest(
|
104 | 104 | hashed_rekord_request_v0_0_2=v2.HashedRekordRequestV002(
|
105 | 105 | digest=artifact_hashed_input.digest,
|
106 | 106 | signature=v2.Signature(
|
107 | 107 | content=artifact_signature,
|
108 | 108 | verifier=v2.Verifier(
|
109 |
| - public_key=v2.PublicKey( |
110 |
| - raw_bytes=signining_certificate.public_key().public_bytes( |
111 |
| - encoding=serialization.Encoding.DER, |
112 |
| - format=serialization.PublicFormat.SubjectPublicKeyInfo, |
| 109 | + x509_certificate=common_v1.X509Certificate( |
| 110 | + raw_bytes=signing_certificate.public_bytes( |
| 111 | + encoding=serialization.Encoding.DER |
113 | 112 | )
|
114 | 113 | ),
|
115 | 114 | key_details=DEFAULT_KEY_DETAILS, # type: ignore[arg-type]
|
@@ -137,10 +136,9 @@ def _build_dsse_create_entry_request(
|
137 | 136 | ),
|
138 | 137 | verifiers=[
|
139 | 138 | v2.Verifier(
|
140 |
| - public_key=v2.PublicKey( |
141 |
| - raw_bytes=signing_certificate.public_key().public_bytes( |
142 |
| - encoding=serialization.Encoding.DER, |
143 |
| - format=serialization.PublicFormat.SubjectPublicKeyInfo, |
| 139 | + x509_certificate=common_v1.X509Certificate( |
| 140 | + raw_bytes=signing_certificate.public_bytes( |
| 141 | + encoding=serialization.Encoding.DER |
144 | 142 | )
|
145 | 143 | ),
|
146 | 144 | key_details=DEFAULT_KEY_DETAILS, # type: ignore[arg-type]
|
|
0 commit comments