verify-macos-signature.d.mts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import type { MacOSSigningEnvironment } from './desktop-release-environment.mjs'
  2. /**
  3. * Reject signature metadata that does not name the company release authority and team.
  4. * @param details - Output from `codesign --display --verbose=4`.
  5. * @param expected - Public release identity.
  6. */
  7. export function assertMacOSSignatureDetails(details: string, expected: MacOSSigningEnvironment): void
  8. /**
  9. * Require the signature properties Apple validates for executable runtime content.
  10. * @param details - Output from `codesign --display --verbose=4`.
  11. * @param expected - Public release identity.
  12. */
  13. export function assertMacOSRuntimeSignatureDetails(details: string, expected: MacOSSigningEnvironment): void
  14. /**
  15. * Sign one Mach-O file embedded in the runtime tree.
  16. * @param path - Writable standalone Mach-O file.
  17. * @param identifier - Stable code-signing identifier derived from the release app ID and CAS digest.
  18. * @param expected - Public release identity.
  19. * @returns Resolves after codesign exits successfully.
  20. */
  21. export function signMacOSRuntimeCode(
  22. path: string,
  23. identifier: string,
  24. expected: MacOSSigningEnvironment,
  25. ): Promise<void>
  26. /**
  27. * Verify one Mach-O file embedded in the runtime tree.
  28. * @param path - Mach-O file to inspect.
  29. * @param expected - Public release identity.
  30. */
  31. export function verifyMacOSRuntimeCode(path: string, expected: MacOSSigningEnvironment): void
  32. /**
  33. * Verify the full application signature and its release owner.
  34. * @param appPath - Path to the packaged `.app` directory.
  35. * @param expected - Public release identity.
  36. */
  37. export function verifyMacOSSignature(appPath: string, expected: MacOSSigningEnvironment): void
  38. /**
  39. * Verify an independently distributed application's signature, ticket, and Gatekeeper acceptance.
  40. * @param appPath - Path to the stapled `.app` directory.
  41. * @param expected - Public release identity.
  42. */
  43. export function verifyMacOSNotarizedApplication(appPath: string, expected: MacOSSigningEnvironment): void
  44. /**
  45. * Verify the release identity, stapled ticket, and Gatekeeper acceptance of one disk image.
  46. * @param diskImagePath - Path to the packaged `.dmg` file.
  47. * @param expected - Public release identity.
  48. */
  49. export function verifyMacOSDiskImage(
  50. diskImagePath: string,
  51. expected: MacOSSigningEnvironment,
  52. ): void
  53. /** Electron-builder fields required to locate a signed macOS application. */
  54. export interface MacOSAfterSignContext {
  55. readonly electronPlatformName: string
  56. readonly appOutDir: string
  57. readonly packager: {
  58. readonly appInfo: {
  59. readonly productFilename: string
  60. }
  61. }
  62. }
  63. /**
  64. * Verify the macOS application produced by electron-builder's signing phase.
  65. * @param context - electron-builder hook context.
  66. * @param expected - Public release identity.
  67. */
  68. export function verifyMacOSSignatureAfterSign(
  69. context: MacOSAfterSignContext,
  70. expected: MacOSSigningEnvironment,
  71. ): void