- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Suite release / finalize (push) Has been skipped
Suite release / deliver (push) Has been skipped
Suite release / check-package (push) Has been skipped
Suite release / reused-checks (push) Has been skipped
Suite release / deliver-prune (push) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (push) Has been skipped
Suite release / publish (push) Has been skipped
Suite release / reserve (push) Has been skipped
Suite release / deploy-image (push) Has been skipped
Suite release / check-manifest (push) Has been skipped
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (push) Has been skipped
Suite release / scope (push) Successful in 53s
Suite release / module (push) Has been skipped
|
||
| authenticode_windows.go | ||
| authenticode_windows_test.go | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
authenticode
Signs Windows programs on a home PC with the at-terminal certificate, the one every release
carries, so a local build is signed as a release is
(AHT-229). Like the release suite's signing
(pipeline-templates'
suites/release/sign-windows.ps1), the signature is SHA-256 with no timestamp.
Install(pfx, password, thumbprint): puts the certificate in the user's own store (CurrentUser\My) with its private key marked non-exportable. home-sync does this on every home PC.Installed(thumbprint)andRemove(thumbprint): whether it is there, and taking it out.Sign(file): signs an exe or dll with it. sign-build runs this on a local build.Thumbprint(der): a certificate's SHA-1 thumbprint, as Windows shows it.
Windows only. It was at-home-tools' internal/authenticode until shared packages got
repositories of their own (AGT-85,
AHT-258).
Using it
require forgejo.romaine.life/romaine-life/authenticode v0.1.1
import "forgejo.romaine.life/romaine-life/authenticode"
if ok, err := authenticode.Installed(thumb); err == nil && !ok {
err = authenticode.Install(pfx, password, thumb)
}
Testing
go test ./... on Windows. The install-and-sign test makes a throwaway certificate, installs
it in the user's store the way home-sync installs the at-terminal one, signs a program with it
and removes the certificate and its key after. It skips in CI, whose runner can't hold a user
key, and in an elevated process.
Shipping
A library: the release-module topic in pipeline-templates' fleet.json tags each merge that
changes the code, and every fleet repository whose go.mod requires it gets a take-up. Forgejo
pushes it to its public GitHub copy, which proxy.golang.org serves to builds outside CI.