serialized.d.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { Envelope } from '@sigstore/protobuf-specs';
  2. import { Bundle } from './bundle';
  3. import type { OneOf } from './utility';
  4. export declare const bundleFromJSON: (obj: unknown) => Bundle;
  5. export declare const bundleToJSON: (bundle: Bundle) => SerializedBundle;
  6. export declare const envelopeFromJSON: (obj: unknown) => Envelope;
  7. export declare const envelopeToJSON: (envelope: Envelope) => SerializedEnvelope;
  8. type SerializedTLogEntry = {
  9. logIndex: string;
  10. logId: {
  11. keyId: string;
  12. };
  13. kindVersion: {
  14. kind: string;
  15. version: string;
  16. } | undefined;
  17. integratedTime: string;
  18. inclusionPromise: {
  19. signedEntryTimestamp: string;
  20. } | undefined;
  21. inclusionProof: {
  22. logIndex: string;
  23. rootHash: string;
  24. treeSize: string;
  25. hashes: string[];
  26. checkpoint: {
  27. envelope: string;
  28. };
  29. } | undefined;
  30. canonicalizedBody: string;
  31. };
  32. type SerializedTimestampVerificationData = {
  33. rfc3161Timestamps: {
  34. signedTimestamp: string;
  35. }[];
  36. };
  37. type SerializedMessageSignature = {
  38. messageDigest: {
  39. algorithm: string;
  40. digest: string;
  41. } | undefined;
  42. signature: string;
  43. };
  44. export type SerializedEnvelope = {
  45. payload: string;
  46. payloadType: string;
  47. signatures: {
  48. sig: string;
  49. keyid: string;
  50. }[];
  51. };
  52. export type SerializedBundle = {
  53. mediaType: string;
  54. verificationMaterial: (OneOf<{
  55. x509CertificateChain: {
  56. certificates: {
  57. rawBytes: string;
  58. }[];
  59. };
  60. publicKey: {
  61. hint: string;
  62. };
  63. certificate: {
  64. rawBytes: string;
  65. };
  66. }> | undefined) & {
  67. tlogEntries: SerializedTLogEntry[];
  68. timestampVerificationData: SerializedTimestampVerificationData | undefined;
  69. };
  70. } & OneOf<{
  71. dsseEnvelope: SerializedEnvelope;
  72. messageSignature: SerializedMessageSignature;
  73. }>;
  74. export {};