Documentation
¶
Overview ¶
Package applesign writes Apple code signatures without platform executables. Signature formats are implementation details; interoperability is tested with Apple's codesign verifier, independently of this package's parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundleExecutable ¶
BundleExecutable locates a canonical app's main executable without following symlinked metadata or code directories. The returned path is absolute.
func CopyBundle ¶
CopyBundle creates a fresh copy for signing or stapling, preserving regular file modes and relative symlinks while rejecting links outside the input. It removes partial output on failure and never overwrites an existing path.
func SignBundle ¶
SignBundle copies and signs a canonical macOS Contents-layout app bundle. Nested application bundles and Mach-O helpers are signed from the inside out. Output must not exist; callers can transactionally publish the completed copy.
Types ¶
type CodeIdentity ¶
func Inspect ¶
func Inspect(path string) ([]CodeIdentity, error)
Inspect returns code-directory identities for ticket lookup. It validates structural bounds, not certificate trust or the integrity of signed content.
func SignDMG ¶
SignDMG embeds a signature between a UDIF image's payload and trailing header. The payload is unchanged. The header is sealed in special slot 6 with its signature size zeroed, matching Apple's independently generated disk images.
func SignMachO ¶
func SignMachO(ctx context.Context, input, output string, options Options) (identities []CodeIdentity, err error)
SignMachO writes a new signed file. Input remains untouched, output must not exist, and partial output is removed on failure. Both native Wails desktop architectures are supported, independently signed in a universal executable.
type Options ¶
type Options struct {
Identifier string
TeamID string
Entitlements []byte
HardenedRuntime bool
// SignCMS returns a detached CMS signature over the complete CodeDirectory.
// A nil callback selects an ad-hoc signature. Key loading, certificate policy
// and timestamp validation belong to the shared signing-identity layer.
SignCMS func(context.Context, []byte) ([]byte, error)
// contains filtered or unexported fields
}
func SigningOptions ¶
func SigningOptions(identity codesignature.Identity, timestamp codesignature.Options) (Options, error)
SigningOptions constructs certificate-backed signing options, sharing the authenticated PFX/CMS/timestamp implementation with Windows signing. Set the returned Identifier for files or DMGs; bundle identifiers come from Info.plist. Timestamping uses only the explicitly configured server and trust roots. Notarized Developer ID distribution requires a compatible secure timestamp; callers must enforce that policy before submitting an artifact.