bundle.js 1.2 KB

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