node-ovsx-sign
v1.2.0
Published
A package for signing and verifying VS Code extensions
Readme
node-ovsx-sign
This package is an open-source alternative to Microsoft's proprietary @vscode/vsce-sign package, which enables a feature in VS Code called Repository signing.
Compatibility with @vscode/vsce-sign
Both the @vscode/vsce-sign package and node-ovsx-sign are pluggable into VS Code's signature verification process and work as expected. That said, there are a few important differences between the two:
node-ovsx-signuses PKCS #8 private keys for signing extension archives while@vscode/vsce-signuses PKCS #7 for signatures. This also means thatnode-ovsx-signsignatures are stored in a.signature.sigfile, while@vscode/vsce-signsignatures are stored in a.signature.p7sfile.[^1]node-ovsx-signdoes not offer any platform-specific packages, because it does not ship any binaries.
Additionally, both packages produce interoperable signature manifests which include the size and SHA 256 digest of every file inside of the .vsix extension archive. These are stored in a .signature.manifest JSON file.
Installing globally
npm i -g node-ovsx-signExample usage of signing [CLI]
[!NOTE] This requires access to the server-side private key for signing.
node-ovsx-sign sign extension.vsix keys/private.pemExample usage of verifying [Node module]
import { verify, ExtensionSignatureVerificationError } from "node-ovsx-sign";
(async () => {
try {
await verify("extension.vsix", "extension.sigzip");
console.log("Signature verified successfully");
} catch (e) {
if (e instanceof ExtensionSignatureVerificationError) {
console.error("Could not verify extension signature");
} else {
throw e;
}
}
})();[^1]: The signature file for both packages is contained in a .sigzip archive, which VS Code unzips and verifies. VS Code also requires a .signature.p7s to be present in the archive, so node-ovsx-sign includes an empty one while storing the actual signature in a .signature.sig file.
