@freedomofpress/sigstore-browser 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +20 -16
  2. package/dist/bundle.d.ts +3 -2
  3. package/dist/bundle.js +66 -1
  4. package/dist/bundle.js.map +1 -1
  5. package/dist/cli.d.ts +0 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/dsse.d.ts +0 -1
  8. package/dist/dsse.js.map +1 -1
  9. package/dist/errors.d.ts +0 -1
  10. package/dist/errors.js.map +1 -1
  11. package/dist/index.d.ts +9 -10
  12. package/dist/index.js +5 -5
  13. package/dist/index.js.map +1 -1
  14. package/dist/interfaces.d.ts +18 -4
  15. package/dist/interfaces.js +15 -1
  16. package/dist/interfaces.js.map +1 -1
  17. package/dist/oid.d.ts +0 -1
  18. package/dist/oid.js.map +1 -1
  19. package/dist/policy.d.ts +3 -4
  20. package/dist/policy.js +5 -5
  21. package/dist/policy.js.map +1 -1
  22. package/dist/rfc3161/error.d.ts +0 -1
  23. package/dist/rfc3161/error.js.map +1 -1
  24. package/dist/rfc3161/index.d.ts +0 -1
  25. package/dist/rfc3161/index.js.map +1 -1
  26. package/dist/rfc3161/timestamp.d.ts +0 -1
  27. package/dist/rfc3161/timestamp.js.map +1 -1
  28. package/dist/rfc3161/tstinfo.d.ts +0 -1
  29. package/dist/rfc3161/tstinfo.js.map +1 -1
  30. package/dist/sigstore.d.ts +10 -20
  31. package/dist/sigstore.js +167 -400
  32. package/dist/sigstore.js.map +1 -1
  33. package/dist/timestamp/tsa.d.ts +6 -3
  34. package/dist/timestamp/tsa.js +16 -19
  35. package/dist/timestamp/tsa.js.map +1 -1
  36. package/dist/tlog/body.d.ts +3 -2
  37. package/dist/tlog/body.js +19 -6
  38. package/dist/tlog/body.js.map +1 -1
  39. package/dist/tlog/checkpoint.d.ts +2 -3
  40. package/dist/tlog/checkpoint.js +17 -95
  41. package/dist/tlog/checkpoint.js.map +1 -1
  42. package/dist/tlog/dsse.d.ts +3 -3
  43. package/dist/tlog/dsse.js +11 -5
  44. package/dist/tlog/dsse.js.map +1 -1
  45. package/dist/tlog/hashedrekord.d.ts +3 -3
  46. package/dist/tlog/hashedrekord.js +8 -5
  47. package/dist/tlog/hashedrekord.js.map +1 -1
  48. package/dist/tlog/intoto.d.ts +3 -3
  49. package/dist/tlog/intoto.js +3 -1
  50. package/dist/tlog/intoto.js.map +1 -1
  51. package/dist/tlog/merkle.d.ts +0 -1
  52. package/dist/tlog/merkle.js.map +1 -1
  53. package/dist/trust/tuf-root.d.ts +0 -1
  54. package/dist/trust/tuf-root.js.map +1 -1
  55. package/dist/trust/tuf.d.ts +0 -1
  56. package/dist/trust/tuf.js.map +1 -1
  57. package/dist/x509/cert.d.ts +0 -1
  58. package/dist/x509/cert.js +1 -1
  59. package/dist/x509/cert.js.map +1 -1
  60. package/dist/x509/chain.d.ts +0 -1
  61. package/dist/x509/chain.js +2 -2
  62. package/dist/x509/chain.js.map +1 -1
  63. package/dist/x509/ext.d.ts +0 -1
  64. package/dist/x509/ext.js.map +1 -1
  65. package/dist/x509/index.d.ts +1 -2
  66. package/dist/x509/index.js +1 -1
  67. package/dist/x509/index.js.map +1 -1
  68. package/dist/x509/sct.d.ts +0 -1
  69. package/dist/x509/sct.js.map +1 -1
  70. package/package.json +15 -8
  71. package/.github/workflows/conformance.yml +0 -29
  72. package/.github/workflows/publish.yml +0 -47
  73. package/dist/bundle.d.ts.map +0 -1
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/dsse.d.ts.map +0 -1
  76. package/dist/errors.d.ts.map +0 -1
  77. package/dist/index.d.ts.map +0 -1
  78. package/dist/interfaces.d.ts.map +0 -1
  79. package/dist/oid.d.ts.map +0 -1
  80. package/dist/policy.d.ts.map +0 -1
  81. package/dist/rfc3161/error.d.ts.map +0 -1
  82. package/dist/rfc3161/index.d.ts.map +0 -1
  83. package/dist/rfc3161/timestamp.d.ts.map +0 -1
  84. package/dist/rfc3161/tstinfo.d.ts.map +0 -1
  85. package/dist/sigstore.d.ts.map +0 -1
  86. package/dist/timestamp/tsa.d.ts.map +0 -1
  87. package/dist/tlog/body.d.ts.map +0 -1
  88. package/dist/tlog/checkpoint.d.ts.map +0 -1
  89. package/dist/tlog/dsse.d.ts.map +0 -1
  90. package/dist/tlog/hashedrekord.d.ts.map +0 -1
  91. package/dist/tlog/intoto.d.ts.map +0 -1
  92. package/dist/tlog/merkle.d.ts.map +0 -1
  93. package/dist/trust/tuf-root.d.ts.map +0 -1
  94. package/dist/trust/tuf.d.ts.map +0 -1
  95. package/dist/x509/cert.d.ts.map +0 -1
  96. package/dist/x509/chain.d.ts.map +0 -1
  97. package/dist/x509/ext.d.ts.map +0 -1
  98. package/dist/x509/index.d.ts.map +0 -1
  99. package/dist/x509/sct.d.ts.map +0 -1
  100. package/eslint.config.mjs +0 -31
  101. package/src/bundle.ts +0 -99
  102. package/src/cli.ts +0 -290
  103. package/src/dsse.ts +0 -49
  104. package/src/errors.ts +0 -82
  105. package/src/index.browser.test.ts +0 -290
  106. package/src/index.ts +0 -93
  107. package/src/interfaces.ts +0 -123
  108. package/src/oid.ts +0 -34
  109. package/src/policy.ts +0 -476
  110. package/src/rfc3161/error.ts +0 -16
  111. package/src/rfc3161/index.ts +0 -17
  112. package/src/rfc3161/timestamp.ts +0 -268
  113. package/src/rfc3161/tstinfo.ts +0 -78
  114. package/src/sigstore.ts +0 -948
  115. package/src/timestamp/tsa.ts +0 -211
  116. package/src/tlog/body.ts +0 -65
  117. package/src/tlog/checkpoint.ts +0 -254
  118. package/src/tlog/dsse.ts +0 -147
  119. package/src/tlog/hashedrekord.ts +0 -130
  120. package/src/tlog/intoto.ts +0 -106
  121. package/src/tlog/merkle.ts +0 -152
  122. package/src/trust/README.md +0 -38
  123. package/src/trust/tuf-root.ts +0 -3
  124. package/src/trust/tuf.ts +0 -233
  125. package/src/x509/cert.ts +0 -569
  126. package/src/x509/chain.ts +0 -212
  127. package/src/x509/ext.ts +0 -356
  128. package/src/x509/index.ts +0 -19
  129. package/src/x509/sct.ts +0 -156
  130. package/tsconfig.json +0 -18
  131. package/vite.config.playwright.ts +0 -14
  132. package/vite.config.ts +0 -18
package/src/index.ts DELETED
@@ -1,93 +0,0 @@
1
- export { SigstoreVerifier } from "./sigstore.js";
2
- export type { SigstoreVerifierOptions } from "./sigstore.js";
3
- export type { SigstoreBundle, TLogEntry, VerificationMaterial, MessageSignature, TimestampVerificationData, RFC3161Timestamp } from "./bundle.js";
4
- export type { TrustedRoot, Sigstore, RawTimestampAuthority } from "./interfaces.js";
5
- export {
6
- VerificationError,
7
- TimestampError,
8
- CertificateError,
9
- TLogError,
10
- SignatureError,
11
- PolicyError,
12
- } from "./errors.js";
13
- export { verifyRFC3161Timestamp, verifyBundleTimestamp } from "./timestamp/tsa.js";
14
- export { TrustedRootProvider, type TrustedRootProviderOptions } from "./trust/tuf.js";
15
- export {
16
- X509Certificate,
17
- EXTENSION_OID_SCT,
18
- EXTENSION_OID_FULCIO_ISSUER_V1,
19
- EXTENSION_OID_GITHUB_WORKFLOW_TRIGGER,
20
- EXTENSION_OID_GITHUB_WORKFLOW_SHA,
21
- EXTENSION_OID_GITHUB_WORKFLOW_NAME,
22
- EXTENSION_OID_GITHUB_WORKFLOW_REPOSITORY,
23
- EXTENSION_OID_GITHUB_WORKFLOW_REF,
24
- EXTENSION_OID_OTHERNAME,
25
- EXTENSION_OID_FULCIO_ISSUER_V2,
26
- EXTENSION_OID_BUILD_SIGNER_URI,
27
- EXTENSION_OID_BUILD_SIGNER_DIGEST,
28
- EXTENSION_OID_RUNNER_ENVIRONMENT,
29
- EXTENSION_OID_SOURCE_REPOSITORY_URI,
30
- EXTENSION_OID_SOURCE_REPOSITORY_DIGEST,
31
- EXTENSION_OID_SOURCE_REPOSITORY_REF,
32
- EXTENSION_OID_SOURCE_REPOSITORY_IDENTIFIER,
33
- EXTENSION_OID_SOURCE_REPOSITORY_OWNER_URI,
34
- EXTENSION_OID_SOURCE_REPOSITORY_OWNER_IDENTIFIER,
35
- EXTENSION_OID_BUILD_CONFIG_URI,
36
- EXTENSION_OID_BUILD_CONFIG_DIGEST,
37
- EXTENSION_OID_BUILD_TRIGGER,
38
- EXTENSION_OID_RUN_INVOCATION_URI,
39
- EXTENSION_OID_SOURCE_REPOSITORY_VISIBILITY,
40
- } from "./x509/cert.js";
41
- export {
42
- X509Extension,
43
- X509FulcioIssuerV1,
44
- X509FulcioIssuerV2,
45
- X509GitHubWorkflowTriggerExtension,
46
- X509GitHubWorkflowSHAExtension,
47
- X509GitHubWorkflowNameExtension,
48
- X509GitHubWorkflowRepositoryExtension,
49
- X509GitHubWorkflowRefExtension,
50
- X509BuildSignerURIExtension,
51
- X509BuildSignerDigestExtension,
52
- X509RunnerEnvironmentExtension,
53
- X509SourceRepositoryURIExtension,
54
- X509SourceRepositoryDigestExtension,
55
- X509SourceRepositoryRefExtension,
56
- X509SourceRepositoryIdentifierExtension,
57
- X509SourceRepositoryOwnerURIExtension,
58
- X509SourceRepositoryOwnerIdentifierExtension,
59
- X509BuildConfigURIExtension,
60
- X509BuildConfigDigestExtension,
61
- X509BuildTriggerExtension,
62
- X509RunInvocationURIExtension,
63
- X509SourceRepositoryVisibilityExtension,
64
- } from "./x509/ext.js";
65
- export { CertificateChainVerifier } from "./x509/chain.js";
66
- export {
67
- GITHUB_OIDC_ISSUER,
68
- OIDCIssuer,
69
- OIDCIssuerV2,
70
- GitHubWorkflowTrigger,
71
- GitHubWorkflowSHA,
72
- GitHubWorkflowName,
73
- GitHubWorkflowRepository,
74
- GitHubWorkflowRef,
75
- OIDCBuildSignerURI,
76
- OIDCBuildSignerDigest,
77
- OIDCRunnerEnvironment,
78
- OIDCSourceRepositoryURI,
79
- OIDCSourceRepositoryDigest,
80
- OIDCSourceRepositoryRef,
81
- OIDCSourceRepositoryIdentifier,
82
- OIDCSourceRepositoryOwnerURI,
83
- OIDCSourceRepositoryOwnerIdentifier,
84
- OIDCBuildConfigURI,
85
- OIDCBuildConfigDigest,
86
- OIDCBuildTrigger,
87
- OIDCRunInvocationURI,
88
- OIDCSourceRepositoryVisibility,
89
- AllOf,
90
- AnyOf,
91
- Identity,
92
- } from "./policy.js";
93
- export type { VerificationPolicy } from "./policy.js";
package/src/interfaces.ts DELETED
@@ -1,123 +0,0 @@
1
- import { X509Certificate } from "./x509/index.js";
2
-
3
- export enum SigstoreRoots {
4
- certificateAuthorities = "certificateAuthorities",
5
- ctlogs = "ctlogs",
6
- timestampAuthorities = "timestampAuthorities",
7
- tlogs = "tlogs",
8
- }
9
-
10
- export type RawTimestampAuthorities = RawTimestampAuthority[];
11
-
12
- export interface TrustedRoot {
13
- mediaType: string;
14
- tlogs: RawLogs;
15
- certificateAuthorities: RawCAs;
16
- ctlogs: RawLogs;
17
- timestampAuthorities: RawTimestampAuthorities;
18
- }
19
-
20
- export interface RawTimestampAuthority {
21
- subject: {
22
- organization: string;
23
- commonName: string;
24
- };
25
- certChain: {
26
- certificates: {
27
- rawBytes: string;
28
- }[];
29
- };
30
- validFor: {
31
- start: string;
32
- end?: string;
33
- };
34
- }
35
-
36
- export interface CTLog {
37
- logID: Uint8Array;
38
- publicKey: CryptoKey;
39
- validFor: {
40
- start: Date;
41
- end: Date;
42
- };
43
- }
44
-
45
- export interface RekorKeyInfo {
46
- publicKey: CryptoKey;
47
- logId: Uint8Array;
48
- }
49
-
50
- export interface CertAuthority {
51
- certChain: X509Certificate[];
52
- validFor: {
53
- start: Date;
54
- end: Date;
55
- };
56
- }
57
-
58
- export interface Sigstore {
59
- rekor: RekorKeyInfo | undefined;
60
- ctlogs: CTLog[];
61
- certificateAuthorities: CertAuthority[];
62
- timestampAuthorities: CertAuthority[];
63
- }
64
-
65
- export interface RawLog {
66
- baseUrl: string;
67
- hashAlgorithm: string;
68
- publicKey: {
69
- rawBytes: string;
70
- keyDetails: string;
71
- validFor: {
72
- start: string;
73
- end?: string;
74
- };
75
- };
76
- logId: {
77
- keyId: string;
78
- };
79
- }
80
-
81
- export type RawLogs = RawLog[];
82
-
83
- export interface RawCA {
84
- subject: {
85
- organization: string;
86
- commonName: string;
87
- };
88
- uri: string;
89
- certChain: {
90
- certificates: {
91
- rawBytes: string;
92
- }[];
93
- };
94
- validFor: {
95
- start: string;
96
- end?: string;
97
- };
98
- }
99
-
100
- export type RawCAs = RawCA[];
101
-
102
- // Re-export crypto enums from crypto-browser (shared with tuf-browser)
103
- export { KeyTypes, EcdsaTypes, HashAlgorithms } from "@freedomofpress/crypto-browser";
104
- import { HashAlgorithms } from "@freedomofpress/crypto-browser";
105
-
106
- // Supported hash algorithms for payload hash validation
107
- // Rekor v1 uses lowercase (sha256), Rekor v2 uses uppercase with underscore (SHA2_256)
108
- const SUPPORTED_HASH_ALGORITHMS: Record<string, string> = {
109
- "sha256": HashAlgorithms.SHA256,
110
- "sha384": HashAlgorithms.SHA384,
111
- "sha512": HashAlgorithms.SHA512,
112
- "SHA2_256": HashAlgorithms.SHA256,
113
- "SHA2_384": HashAlgorithms.SHA384,
114
- "SHA2_512": HashAlgorithms.SHA512,
115
- };
116
-
117
- export function getHashAlgorithm(algorithm: string): string {
118
- const hashAlg = SUPPORTED_HASH_ALGORITHMS[algorithm];
119
- if (!hashAlg) {
120
- throw new Error(`Unsupported hash algorithm: ${algorithm}`);
121
- }
122
- return hashAlg;
123
- }
package/src/oid.ts DELETED
@@ -1,34 +0,0 @@
1
- // From https://github.com/sigstore/sigstore-js/blob/main/packages/core/src/oid.ts
2
-
3
- export const ECDSA_SIGNATURE_ALGOS: Record<string, string> = {
4
- "1.2.840.10045.4.3.1": "sha224",
5
- "1.2.840.10045.4.3.2": "sha256",
6
- "1.2.840.10045.4.3.3": "sha384",
7
- "1.2.840.10045.4.3.4": "sha512",
8
- };
9
-
10
- // RSA signature algorithms (PKCS#1 v1.5)
11
- export const RSA_SIGNATURE_ALGOS: Record<string, string> = {
12
- "1.2.840.113549.1.1.11": "sha256", // sha256WithRSAEncryption
13
- "1.2.840.113549.1.1.12": "sha384", // sha384WithRSAEncryption
14
- "1.2.840.113549.1.1.13": "sha512", // sha512WithRSAEncryption
15
- "1.2.840.113549.1.1.5": "sha1", // sha1WithRSAEncryption
16
- };
17
-
18
- // RSASSA-PSS OID - hash algorithm must be parsed from signature algorithm parameters
19
- export const OID_RSASSA_PSS = "1.2.840.113549.1.1.10";
20
-
21
- export const SHA2_HASH_ALGOS: Record<string, string> = {
22
- "2.16.840.1.101.3.4.2.1": "sha256",
23
- "2.16.840.1.101.3.4.2.2": "sha384",
24
- "2.16.840.1.101.3.4.2.3": "sha512",
25
- };
26
-
27
- // Default hash algorithm used when not specified
28
- export const DEFAULT_HASH_ALGORITHM = "sha256";
29
-
30
- export const ECDSA_CURVE_NAMES: Record<string, string> = {
31
- "1.2.840.10045.3.1.7": "secp256r1",
32
- "1.3.132.0.34": "secp384r1",
33
- "1.3.132.0.35": "secp521r1",
34
- };