Skip to content

Commit bd1e1e1

Browse files
authoredJun 12, 2023
sigstore type refactoring (#550)
Signed-off-by: Brian DeHamer <bdehamer@github.com>
1 parent 24abc28 commit bd1e1e1

File tree

17 files changed

+120
-131
lines changed

17 files changed

+120
-131
lines changed
 

‎.changeset/lucky-mangos-hug.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'sigstore': patch
3+
---
4+
5+
Internal refactoring of Typescript types

‎packages/client/src/__tests__/__fixtures__/trust.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import * as sigstore from '../../types/sigstore';
16+
import { TrustedRoot } from '@sigstore/protobuf-specs';
17+
1718
const trustedRootJSON = {
1819
mediaType: 'application/vnd.dev.sigstore.trustedroot+json;version=0.1',
1920
tlogs: [
@@ -103,4 +104,4 @@ const trustedRootJSON = {
103104
timestampAuthorities: [],
104105
};
105106

106-
export const trustedRoot = sigstore.TrustedRoot.fromJSON(trustedRootJSON);
107+
export const trustedRoot = TrustedRoot.fromJSON(trustedRootJSON);

‎packages/client/src/__tests__/ca/verify/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { trustedRoot } from '../../__fixtures__/trust';
2121
describe('verifySigningCertificate', () => {
2222
// Temporary until we reconsole bundle formats
2323
const bundleJSON = bundles.dsse.valid.withSigningCert;
24-
const bundle = sigstore.Bundle.fromJSON(
24+
const bundle = sigstore.bundleFromJSON(
2525
bundleJSON
2626
) as sigstore.BundleWithCertificateChain;
2727

‎packages/client/src/__tests__/sigstore.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { TUFError } from '@sigstore/tuf';
17-
import mocktuf, { Target } from '@tufjs/repo-mock';
18-
import { PolicyError, VerificationError } from '../error';
19-
import { Signer } from '../sign';
20-
import { attest, sign, tuf, verify } from '../sigstore';
2116
import {
2217
Bundle,
2318
HashAlgorithm,
2419
TimestampVerificationData,
2520
TransparencyLogEntry,
2621
TrustedRoot,
2722
X509CertificateChain,
28-
} from '../types/sigstore';
23+
} from '@sigstore/protobuf-specs';
24+
import { TUFError } from '@sigstore/tuf';
25+
import mocktuf, { Target } from '@tufjs/repo-mock';
26+
import { PolicyError, VerificationError } from '../error';
27+
import { Signer } from '../sign';
28+
import { attest, sign, tuf, verify } from '../sigstore';
2929
import bundles from './__fixtures__/bundles';
3030
import { trustedRoot } from './__fixtures__/trust';
3131

‎packages/client/src/__tests__/tlog/verify/index.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { trustedRoot } from '../../__fixtures__/trust';
2222
describe('verifyTLogEntries', () => {
2323
const bundle = sigstore.bundleFromJSON(
2424
bundles.signature.valid.withSigningCert
25-
) as sigstore.BundleWithVerificationMaterial;
25+
) as sigstore.Bundle;
2626

2727
const options: sigstore.ArtifactVerificationOptions_TlogOptions = {
2828
disable: false,
@@ -42,7 +42,7 @@ describe('verifyTLogEntries', () => {
4242
describe('when the bundle does NOT have a signing certificate', () => {
4343
const bundle = sigstore.bundleFromJSON(
4444
bundles.signature.valid.withPublicKey
45-
) as sigstore.BundleWithVerificationMaterial;
45+
) as sigstore.Bundle;
4646

4747
it('does NOT throw an error', () => {
4848
expect(() =>
@@ -83,7 +83,7 @@ describe('verifyTLogEntries', () => {
8383
describe('when tlog entries are missing data necessary for verification', () => {
8484
const bundle = sigstore.bundleFromJSON(
8585
bundles.dsse.invalid.tlogKindVersionMissing
86-
) as sigstore.BundleWithVerificationMaterial;
86+
) as sigstore.Bundle;
8787

8888
it('throws an error', () => {
8989
expect(() => verifyTLogEntries(bundle, trustedRoot, options)).toThrow(

‎packages/client/src/__tests__/types/sigstore/index.test.ts

+3-36
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16+
import type { Entry } from '../../../external/rekor';
1617
import { SignatureMaterial } from '../../../types/signature';
1718
import * as sigstore from '../../../types/sigstore';
1819
import { encoding as enc, pem } from '../../../util';
1920
import bundles from '../../__fixtures__/bundles/';
2021

21-
import type { Entry } from '../../../external/rekor';
22-
23-
describe('isBundleWithVerificationMaterial', () => {
24-
describe('when the bundle contains verification material', () => {
25-
const json = bundles.dsse.valid.withSigningCert;
26-
const bundle = sigstore.Bundle.fromJSON(json);
27-
28-
it('returns true', () => {
29-
expect(sigstore.isBundleWithVerificationMaterial(bundle)).toBe(true);
30-
});
31-
});
32-
33-
describe('when the bundle does NOT contain verification material', () => {
34-
const bundle: sigstore.Bundle = {
35-
mediaType: 'application/vnd.dev.cosign.simplesigning.v1+json',
36-
verificationMaterial: undefined,
37-
content: {
38-
$case: 'messageSignature',
39-
messageSignature: {
40-
messageDigest: {
41-
algorithm: sigstore.HashAlgorithm.SHA2_256,
42-
digest: Buffer.from(''),
43-
},
44-
signature: Buffer.from(''),
45-
},
46-
},
47-
};
48-
49-
it('returns false', () => {
50-
expect(sigstore.isBundleWithVerificationMaterial(bundle)).toBe(false);
51-
});
52-
});
53-
});
54-
5522
describe('isBundleWithCertificateChain', () => {
5623
describe('when the bundle contains a certificate chain', () => {
5724
const json = bundles.dsse.valid.withSigningCert;
58-
const bundle = sigstore.Bundle.fromJSON(json);
25+
const bundle = sigstore.bundleFromJSON(json);
5926

6027
it('returns true', () => {
6128
expect(sigstore.isBundleWithCertificateChain(bundle)).toBe(true);
@@ -64,7 +31,7 @@ describe('isBundleWithCertificateChain', () => {
6431

6532
describe('when the bundle does NOT contain a certificate chain', () => {
6633
const json = bundles.dsse.valid.withPublicKey;
67-
const bundle = sigstore.Bundle.fromJSON(json);
34+
const bundle = sigstore.bundleFromJSON(json);
6835

6936
it('returns false', () => {
7037
expect(sigstore.isBundleWithCertificateChain(bundle)).toBe(false);

‎packages/client/src/__tests__/types/sigstore/serialized.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import {
17-
Bundle,
16+
import { Bundle, hashAlgorithmToJSON } from '@sigstore/protobuf-specs';
17+
import type {
1818
Envelope,
1919
HashAlgorithm,
20-
hashAlgorithmToJSON,
2120
MessageSignature,
2221
PublicKeyIdentifier,
2322
SerializedBundle,

‎packages/client/src/__tests__/types/sigstore/validate.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616
import { ValidationError } from '../../../error';
17-
import {
18-
assertValidBundle,
17+
import { assertValidBundle } from '../../../types/sigstore/validate';
18+
19+
import type {
1920
Bundle,
2021
Signature,
2122
X509Certificate,
22-
} from '../../../types/sigstore';
23+
} from '@sigstore/protobuf-specs';
2324

2425
describe('assertValidBundle', () => {
2526
describe('when the bundle is completely empty', () => {

‎packages/client/src/__tests__/x509/cert.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import * as sigstore from '../../types/sigstore';
16+
import { TransparencyLogInstance } from '@sigstore/protobuf-specs';
1717
import { pem } from '../../util';
1818
import { x509Certificate } from '../../x509/cert';
1919
import { certificates } from '../__fixtures__/certs';
@@ -290,8 +290,8 @@ describe('x509Certificate', () => {
290290
logId: { keyId: 'CGCS8ChS/2hF0dFrJ4ScRWcYrBY9wzjSbea8IgY2b3I=' },
291291
};
292292

293-
const logs: sigstore.TransparencyLogInstance[] = [
294-
sigstore.TransparencyLogInstance.fromJSON(ctl),
293+
const logs: TransparencyLogInstance[] = [
294+
TransparencyLogInstance.fromJSON(ctl),
295295
];
296296

297297
describe('when the certificate does NOT have an SCT extension', () => {

‎packages/client/src/__tests__/x509/sct.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import * as sigstore from '../../types/sigstore';
16+
import { TransparencyLogInstance } from '@sigstore/protobuf-specs';
1717
import { SignedCertificateTimestamp } from '../../x509/sct';
1818

1919
describe('SignedCertificateTimestamp', () => {
@@ -130,8 +130,8 @@ describe('SignedCertificateTimestamp', () => {
130130
logId: { keyId: Buffer.from(logID, 'hex') },
131131
};
132132

133-
const logs: sigstore.TransparencyLogInstance[] = [
134-
sigstore.TransparencyLogInstance.fromJSON(ctl),
133+
const logs: TransparencyLogInstance[] = [
134+
TransparencyLogInstance.fromJSON(ctl),
135135
];
136136

137137
describe('when the signature is valid', () => {

‎packages/client/src/sigstore-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ export async function createRekorEntry(
6565
signature: sigMaterial,
6666
tlogEntry: entry,
6767
});
68-
return sigstore.Bundle.toJSON(bundle) as sigstore.SerializedBundle;
68+
return sigstore.bundleToJSON(bundle) as sigstore.SerializedBundle;
6969
}

‎packages/client/src/sigstore.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function sign(
3636
});
3737

3838
const bundle = await signer.signBlob(payload);
39-
return sigstore.Bundle.toJSON(bundle) as sigstore.SerializedBundle;
39+
return sigstore.bundleToJSON(bundle) as sigstore.SerializedBundle;
4040
}
4141

4242
export async function attest(
@@ -59,7 +59,7 @@ export async function attest(
5959
});
6060

6161
const bundle = await signer.signAttestation(payload, payloadType);
62-
return sigstore.Bundle.toJSON(bundle) as sigstore.SerializedBundle;
62+
return sigstore.bundleToJSON(bundle) as sigstore.SerializedBundle;
6363
}
6464

6565
export async function verify(

‎packages/client/src/tlog/verify/index.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { verifyTLogSET } from './set';
2222
// Verifies that the number of tlog entries that pass offline verification
2323
// is greater than or equal to the threshold specified in the options.
2424
export function verifyTLogEntries(
25-
bundle: sigstore.BundleWithVerificationMaterial,
25+
bundle: sigstore.Bundle,
2626
trustedRoot: sigstore.TrustedRoot,
2727
options: sigstore.ArtifactVerificationOptions_TlogOptions
2828
): void {
@@ -31,7 +31,7 @@ export function verifyTLogEntries(
3131
}
3232

3333
// Extract the signing cert, if available
34-
const signingCert = sigstore.signingCertificate(bundle);
34+
const signingCert = signingCertificate(bundle);
3535

3636
// Iterate over the tlog entries and verify each one
3737
const verifiedEntries = bundle.verificationMaterial.tlogEntries.filter(
@@ -74,3 +74,15 @@ function verifyTLogEntryOffline(
7474
verifyTLogIntegrationTime()
7575
);
7676
}
77+
78+
function signingCertificate(
79+
bundle: sigstore.Bundle
80+
): x509Certificate | undefined {
81+
if (!sigstore.isBundleWithCertificateChain(bundle)) {
82+
return undefined;
83+
}
84+
85+
const signingCert =
86+
bundle.verificationMaterial.content.x509CertificateChain.certificates[0];
87+
return x509Certificate.parse(signingCert.rawBytes);
88+
}

‎packages/client/src/types/sigstore/index.ts

+55-46
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,54 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import {
16+
import { Bundle, HashAlgorithm } from '@sigstore/protobuf-specs';
17+
import { encoding as enc, pem } from '../../util';
18+
import { SignatureMaterial } from '../signature';
19+
import { ValidBundle, assertValidBundle } from './validate';
20+
21+
import type {
1722
ArtifactVerificationOptions,
18-
Bundle,
1923
Envelope,
20-
HashAlgorithm,
2124
TimestampVerificationData,
2225
TransparencyLogEntry,
2326
VerificationMaterial,
2427
} from '@sigstore/protobuf-specs';
25-
import { encoding as enc, pem } from '../../util';
26-
import { x509Certificate } from '../../x509/cert';
27-
import { WithRequired } from '../utility';
28-
import { ValidBundle, assertValidBundle } from './validate';
29-
3028
import type { Entry, ProposedEntry } from '../../external/rekor';
31-
import type { SignatureMaterial } from '../signature';
29+
import type { WithRequired } from '../utility';
30+
import type { SerializedBundle } from './serialized';
3231

33-
export * from '@sigstore/protobuf-specs';
34-
export * from './serialized';
35-
export * from './validate';
32+
// Enums from protobuf-specs
33+
// TODO: Move Envelope to "type" export once @sigstore/sign is a thing
34+
export {
35+
Envelope,
36+
HashAlgorithm,
37+
PublicKeyDetails,
38+
SubjectAlternativeNameType,
39+
} from '@sigstore/protobuf-specs';
40+
// Types from protobuf-specs
41+
export type {
42+
ArtifactVerificationOptions,
43+
ArtifactVerificationOptions_CtlogOptions,
44+
ArtifactVerificationOptions_TlogOptions,
45+
CertificateAuthority,
46+
CertificateIdentities,
47+
CertificateIdentity,
48+
MessageSignature,
49+
ObjectIdentifierValuePair,
50+
PublicKey,
51+
PublicKeyIdentifier,
52+
RFC3161SignedTimestamp,
53+
Signature,
54+
SubjectAlternativeName,
55+
TimestampVerificationData,
56+
TransparencyLogEntry,
57+
TransparencyLogInstance,
58+
TrustedRoot,
59+
X509Certificate,
60+
X509CertificateChain,
61+
} from '@sigstore/protobuf-specs';
62+
export type { SerializedBundle, SerializedEnvelope } from './serialized';
63+
export type { ValidBundle as Bundle };
3664

3765
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3866
export const bundleFromJSON = (obj: any): ValidBundle => {
@@ -41,26 +69,17 @@ export const bundleFromJSON = (obj: any): ValidBundle => {
4169
return bundle;
4270
};
4371

72+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
73+
export const bundleToJSON = (bundle: ValidBundle): SerializedBundle => {
74+
return Bundle.toJSON(bundle) as SerializedBundle;
75+
};
76+
4477
const BUNDLE_MEDIA_TYPE =
4578
'application/vnd.dev.sigstore.bundle+json;version=0.1';
4679

47-
// Subset of sigstore.Bundle that has verification material as part
48-
// of the bundle
49-
export type BundleWithVerificationMaterial = WithRequired<
50-
Bundle,
51-
'verificationMaterial'
52-
>;
53-
54-
// Type guard for narrowing a Bundle to a BundleWithVerificationMaterial
55-
export function isBundleWithVerificationMaterial(
56-
bundle: Bundle
57-
): bundle is BundleWithVerificationMaterial {
58-
return bundle.verificationMaterial !== undefined;
59-
}
60-
6180
// Subset of sigstore.Bundle that has a certificate chain as part
6281
// of the verification material (as opposed to a public key)
63-
export type BundleWithCertificateChain = Bundle & {
82+
export type BundleWithCertificateChain = ValidBundle & {
6483
verificationMaterial: VerificationMaterial & {
6584
content: Extract<
6685
VerificationMaterial['content'],
@@ -71,10 +90,9 @@ export type BundleWithCertificateChain = Bundle & {
7190

7291
// Type guard for narrowing a Bundle to a BundleWithCertificateChain
7392
export function isBundleWithCertificateChain(
74-
bundle: Bundle
93+
bundle: ValidBundle
7594
): bundle is BundleWithCertificateChain {
7695
return (
77-
isBundleWithVerificationMaterial(bundle) &&
7896
bundle.verificationMaterial.content !== undefined &&
7997
bundle.verificationMaterial.content.$case === 'x509CertificateChain'
8098
);
@@ -122,6 +140,9 @@ export function isVerifiableTransparencyLogEntry(
122140
);
123141
}
124142

143+
// All of the following functions are used to construct a ValidBundle
144+
// from various types of input. When this code moves into the
145+
// @sigstore/sign package, these functions will be exported from there.
125146
export function toDSSEBundle({
126147
envelope,
127148
signature,
@@ -132,7 +153,7 @@ export function toDSSEBundle({
132153
signature: SignatureMaterial;
133154
tlogEntry?: Entry;
134155
timestamp?: Buffer;
135-
}): Bundle {
156+
}): ValidBundle {
136157
return {
137158
mediaType: BUNDLE_MEDIA_TYPE,
138159
content: { $case: 'dsseEnvelope', dsseEnvelope: envelope },
@@ -154,7 +175,7 @@ export function toMessageSignatureBundle({
154175
signature: SignatureMaterial;
155176
tlogEntry?: Entry;
156177
timestamp?: Buffer;
157-
}): Bundle {
178+
}): ValidBundle {
158179
return {
159180
mediaType: BUNDLE_MEDIA_TYPE,
160181
content: {
@@ -210,7 +231,7 @@ function toVerificationMaterial({
210231
signature: SignatureMaterial;
211232
tlogEntry?: Entry;
212233
timestamp?: Buffer;
213-
}): VerificationMaterial {
234+
}): ValidBundle['verificationMaterial'] {
214235
return {
215236
content: signature.certificates
216237
? toVerificationMaterialx509CertificateChain(signature.certificates)
@@ -224,7 +245,7 @@ function toVerificationMaterial({
224245

225246
function toVerificationMaterialx509CertificateChain(
226247
certificates: string[]
227-
): VerificationMaterial['content'] {
248+
): ValidBundle['verificationMaterial']['content'] {
228249
return {
229250
$case: 'x509CertificateChain',
230251
x509CertificateChain: {
@@ -237,7 +258,7 @@ function toVerificationMaterialx509CertificateChain(
237258

238259
function toVerificationMaterialPublicKey(
239260
hint: string
240-
): VerificationMaterial['content'] {
261+
): ValidBundle['verificationMaterial']['content'] {
241262
return { $case: 'publicKey', publicKey: { hint } };
242263
}
243264

@@ -248,15 +269,3 @@ function toTimestampVerificationData(
248269
rfc3161Timestamps: [{ signedTimestamp: timestamp }],
249270
};
250271
}
251-
252-
export function signingCertificate(
253-
bundle: Bundle
254-
): x509Certificate | undefined {
255-
if (!isBundleWithCertificateChain(bundle)) {
256-
return undefined;
257-
}
258-
259-
const signingCert =
260-
bundle.verificationMaterial.content.x509CertificateChain.certificates[0];
261-
return x509Certificate.parse(signingCert.rawBytes);
262-
}

‎packages/client/src/types/sigstore/serialized.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ type SerializedDSSEEnvelope = {
6767
}[];
6868
};
6969

70+
// Serialized form of the DSSE Envelope
71+
export type { SerializedDSSEEnvelope as SerializedEnvelope };
72+
7073
// Serialized form of the Sigstore Bundle union type with all possible options
7174
// represented
7275
export type SerializedBundle = {
@@ -85,15 +88,3 @@ export type SerializedBundle = {
8588
dsseEnvelope: SerializedDSSEEnvelope;
8689
messageSignature: SerializedMessageSignature;
8790
}>;
88-
89-
interface SerializedSignature {
90-
sig: string;
91-
keyid: string;
92-
}
93-
94-
// Serialized form of the DSSE Envelope
95-
export type SerializedEnvelope = {
96-
payload: string;
97-
payloadType: string;
98-
signatures: SerializedSignature[];
99-
};

‎packages/client/src/types/sigstore/validate.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import {
16+
import { ValidationError } from '../../error';
17+
import { WithRequired } from '../utility';
18+
19+
import type {
1720
Bundle,
1821
MessageSignature,
1922
VerificationMaterial,
2023
} from '@sigstore/protobuf-specs';
21-
import { ValidationError } from '../../error';
22-
import { WithRequired } from '../utility';
2324

24-
// Sigstore bundle with all required fields populated
25+
// Sigstore bundle with all required fields populated.
26+
// This is the version of Bundle which should be used for all internal
27+
// functions. Any Bundle which is passed to an internal function should be
28+
// validated with assertValidBundle and cast to ValidBundle.
2529
export type ValidBundle = Bundle & {
2630
verificationMaterial: VerificationMaterial & {
2731
content: NonNullable<VerificationMaterial['content']>;

‎packages/client/src/verify.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class Verifier {
3535
// Verifies the bundle signature, the bundle's certificate chain (if present)
3636
// and the bundle's transparency log entries.
3737
public verify(
38-
bundle: sigstore.ValidBundle,
38+
bundle: sigstore.Bundle,
3939
options: sigstore.RequiredArtifactVerificationOptions,
4040
data?: Buffer
4141
): void {
@@ -53,7 +53,7 @@ export class Verifier {
5353
// Performs bundle signature verification. Determines the type of the bundle
5454
// content and delegates to the appropriate signature verification function.
5555
private verifyArtifactSignature(
56-
bundle: sigstore.ValidBundle,
56+
bundle: sigstore.Bundle,
5757
data?: Buffer
5858
): void {
5959
const publicKey = this.getPublicKey(bundle);
@@ -99,7 +99,7 @@ export class Verifier {
9999
// Performs verification of the bundle's transparency log entries. The bundle
100100
// must contain a list of transparency log entries.
101101
private verifyTLogEntries(
102-
bundle: sigstore.ValidBundle,
102+
bundle: sigstore.Bundle,
103103
options: sigstore.RequiredArtifactVerificationOptions
104104
): void {
105105
tlog.verifyTLogEntries(bundle, this.trustedRoot, options.tlogOptions);
@@ -108,7 +108,7 @@ export class Verifier {
108108
// Returns the public key which will be used to verify the bundle signature.
109109
// The public key is selected based on the verification material in the bundle
110110
// and the options provided.
111-
private getPublicKey(bundle: sigstore.ValidBundle): KeyLike {
111+
private getPublicKey(bundle: sigstore.Bundle): KeyLike {
112112
// Select the key which will be used to verify the signature
113113
switch (bundle.verificationMaterial?.content?.$case) {
114114
// If the bundle contains a certificate chain, the public key is the

0 commit comments

Comments
 (0)
Please sign in to comment.