Skip to content

Commit b268fe9

Browse files
committed
Sign Windows binaries with Azure Trusted Signing.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 981a262 commit b268fe9

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@
120120
}
121121
],
122122
"icon": "build/icon.ico",
123-
"publisherName": "Kandra Labs, Inc."
123+
"publisherName": "Kandra Labs, Inc.",
124+
"sign": "./scripts/win-sign.js",
125+
"signingHashAlgorithms": [
126+
"sha256"
127+
]
124128
},
125129
"msi": {
126130
"artifactName": "${productName}-${version}-${arch}.${ext}"
@@ -308,6 +312,7 @@
308312
},
309313
{
310314
"files": [
315+
"scripts/win-sign.js",
311316
"tests/**/*.js"
312317
],
313318
"parserOptions": {

scripts/win-sign.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"use strict";
2+
3+
const childProcess = require("node:child_process");
4+
const {promisify} = require("node:util");
5+
6+
const exec = promisify(childProcess.exec);
7+
8+
exports.default = async ({path, hash}) => {
9+
await exec(
10+
`powershell.exe Invoke-TrustedSigning \
11+
-Endpoint https://eus.codesigning.azure.net/ \
12+
-CodeSigningAccountName kandralabs \
13+
-CertificateProfileName kandralabs \
14+
-Files '${path}' \
15+
-FileDigest '${hash}' \
16+
-TimestampRfc3161 http://timestamp.acs.microsoft.com \
17+
-TimestampDigest '${hash}'`,
18+
{stdio: "inherit"},
19+
);
20+
};

0 commit comments

Comments
 (0)