codekingpro/portable-devtools
114k
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = void 0;
4exports.isBundleWithCertificateChain = isBundleWithCertificateChain;
5exports.isBundleWithPublicKey = isBundleWithPublicKey;
6exports.isBundleWithMessageSignature = isBundleWithMessageSignature;
7exports.isBundleWithDsseEnvelope = isBundleWithDsseEnvelope;
8exports.BUNDLE_V01_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.1';
9exports.BUNDLE_V02_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.2';
10exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.3';
11exports.BUNDLE_V03_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle.v0.3+json';
12// Type guards for bundle variants.
13function isBundleWithCertificateChain(b) {
14 return b.verificationMaterial.content.$case === 'x509CertificateChain';
15}
16function isBundleWithPublicKey(b) {
17 return b.verificationMaterial.content.$case === 'publicKey';
18}
19function isBundleWithMessageSignature(b) {
20 return b.content.$case === 'messageSignature';
21}
22function isBundleWithDsseEnvelope(b) {
23 return b.content.$case === 'dsseEnvelope';
24}
25 