GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing ebourg.github.io — Jsign - Code signing tool for Windows executables, installers and scripts Jsign is a code signing tool that allows you to sign and timestamp Windows executable files, installer packages and scripts. Jsign is platform independent and provides an alternative to native tools like signtool on Windows or the Mono development tools on Unix systems. It's particularly well-suited for signing executable wrappers and installers generated by tools such as NSIS, msitools, install4j, exe4j or launch4j. It emphasizes on seamless integration with cloud key management systems and hardware tokens. Jsign is available as a command line tool for Linux, macOS and Windows, as a task/plugin for various build systems (Maven, Gradle, Ant, GitHub Actions), and as a Java library. Jsign is free to use and licensed under the Apache License version 2.0. Features
Downloads
Need a not yet released fix of feature? Pick the latest snapshot build from the GitHub actions. Command Line ToolThe general syntax is: jsign [COMMAND] [OPTIONS] [FILE] [PATTERN] [@FILELIST]... If no installation package is available for the system used, Jsign is invoked by running the all-in-one jar: java -jar jsign-7.6.jar [OPTIONS] [FILE]... The supported commands are: After the options Jsign accepts one or more files to sign as arguments. The arguments may contain If an argument starts with @ it is considered as a text file containing a list of files to sign, one per line. The supported file formats are:
The options available depend on the command used. Here are the options for each command: sign
timestamp
extract
removeRemove the signatures from a file. The signatures to remove can be selected by digest algorithm and by certificate name.
show (Jsign 8.0 preview)Displays information about the signatures of a file (certificate, timestamp, digest, tag). The $ jsign show application.exe
Signature of application.exe:
Digest: (SHA-1) d27ec498912807ddfc4bec2be4f62c42814836f3 (matches)
Timestamp: 2026-04-15 19:56:53 CEST (DigiCert SHA256 RSA4096 Timestamp Responder 2025)
Program Name: My Application
URL: https://example.com
Tag: userid:1234-ABCD-5678-EFGH
Certificate
Subject: Jsign Code Signing Test Certificate 2024 (RSA)
Issuer: Jsign Code Signing CA 2024
Key: RSA 2048
Validity: 2024-05-10 - 2044-05-10 (6511 days left)
Serial: 232ae74743b0ae4da74beae15387644af6ca7a03
tag
verify (Jsign 8.0 preview)Verifies the signature of one or more files. The following verifications are performed:
By default, the certificate chains are validated against the root certificates supported by Windows. Extra root
anchors can be supplied with the The command has two levels of detail, by default a summary line is displayed for each signature: $ jsign verify application.exe Signature #1 (SHA1 with RSA 2048) by Jsign Code Signing Test Certificate 2024 is invalid (The file digest does not match the signature) Signature #2 (SHA256 with RSA 4096) by Jsign Code Signing Test Certificate 2026 is valid In verbose mode, a detailed diagnostic is displayed: $ jsign verify --verbose application.exe Signature #1 (SHA1 with RSA 2048) by Jsign Code Signing Test Certificate 2024 is invalid FAIL File Integrity: The file digest does not match the signature expected: d27ec498912807ddfc4bec2be4f62c42814836f3 actual: cb4bc7a2995e6d4b67a56546ecaaf68de6a2efa7 PASS Timestamp: Valid RFC 3161 timestamp (Mon Aug 03 19:49:33 CEST 2026) FAIL Certificate Chain Trust: Certificate chain is not trusted No trust anchor could be established for the chain: Jsign Code Signing Test Certificate 2024 Jsign Code Signing CA 2024 Jsign Root Certificate Authority 2024 PASS Signature Integrity: Signature data is valid Signature #2 (SHA256 with RSA 4096) by Jsign Code Signing Test Certificate 2026 is valid PASS File Integrity: The file digest matches the signature SKIP Timestamp: No timestamp found PASS Certificate Chain Trust: Certificate chain is trusted PASS Signature Integrity: Signature data is valid The command returns the following error codes:
ExamplesSigning with a Java keystore jsign --keystore keystore.jks --storepass password --alias test \
--tsaurl http://timestamp.sectigo.com application.exe
Signing with a SPC certificate and a PVK keyjsign --certfile certificate.spc --keyfile key.pvk --keypass password application.exe Signing with a YubiKeyWhen using a Yubikey, the alias is required only if the device contains more than one certificate. The certificate is specified by its name (typically X.509 Certificate for Digital Signature for the slot 9c, or X.509 Certificate for PIV Authentication for the slot 9a). The ykcs11 library from the Yubico PIV Tool must be installed on the system at the default location. jsign --storetype YUBIKEY --storepass 123456 application.exe Alternatively, the PIV storetype can also be used to sign with a Yubikey and doesn't require the ykcs11 library. Signing with a Nitrokey HSMSigning with a Nitrokey HSM requires the installation of OpenSC. jsign --storetype NITROKEY --storepass 123456 --alias test \
--certfile full-chain.pem application.exe
Other Nitrokeys based on the OpenPGP card standard are also supported with this storetype, but an X.509 certificate must be imported into the Nitrokey (using the gnupg writecert command). Keys without certificates are ignored. Alternatively, the OPENPGP storetype can also be used, it doesn't require OpenSC and any key can be used by providing an external certificate. Signing with a SafeNet eTokenSigning with a SafeNet eToken requires the installation of the SafeNet Authentication Client. jsign --storetype ETOKEN --storepass <PIN> application.exe If multiple tokens are connected, the Signing with a smart cardSigning with a smart card requires the installation of OpenSC. jsign --storetype OPENSC --storepass 123456 --alias test \
--certfile full-chain.pem application.exe
If multiple devices are connected, the Signing with an OpenPGP cardOpenPGP cards contain up to 3 keys, one for signing, one for encryption, and one for authentication. All of them
can be used for code signing (except encryption keys based on an elliptic curve). The alias to select the key is either,
jsign --storetype OPENPGP --storepass 123456 --alias SIGNATURE \
--certfile full-chain.pem application.exe
The If multiple devices are connected, the Signing with a PIV cardPIV cards contain up to 24 keys and certificates. The alias to select the key is either jsign --storetype PIV --storepass 123456 --alias SIGNATURE application.exe If multiple devices are connected, the If the Signing with a CryptoCertum cardThe CryptoCertum cryptographic card from Certum is supported using
the jsign --storetype CRYPTOCERTUM --storepass 123456 --alias test application.exe The Signing with a PKCS#11 tokenJsign tries to support the most common PKCS#11 tokens and smart cards used for signing with a dedicated storetype,
but if your device isn't supported you can use the generic With a file, create a SunPKCS11 configuration file such as name = MyToken library = /path/to/pkcs11/library slot = 0 Then, pass the filename to the jsign --storetype PKCS11 \
--keystore pkcs11.cfg \
--storepass 123456 \
--alias test \
application.exe
For an inline configuration, prefix the jsign --storetype PKCS11 \
--keystore="--name=MyToken\nlibrary=/path/to/pkcs11/library\nslot=0" \
--storepass 123456 \
--alias test \
application.exe
The jsign --storetype PKCS11 \
--keystore SunPKCS11-MyToken \
--storepass 123456 \
--alias test \
application.exe
Signing with AWS Key Management ServiceAWS Key Management Service (KMS) stores only the private key,
the certificate must be provided separately. The The AWS access key, secret key, and optionally the session token, are concatenated
and used as the In any case, the credentials must allow the following actions:
The jsign --storetype AWS \
--keystore eu-west-3 \
--storepass "<access-key>|<secret-key>|<session-token>" \
--alias 12345678-abcd-1234-cdef-1234567890ab \
--certfile full-chain.pem application.exe
Signing with Azure Key VaultCertificates and keys stored in the Azure Key Vault key management system can be used with: jsign --storetype AZUREKEYVAULT \
--keystore vaultname \
--storepass <api-access-token> \
--alias test application.exe
The access token can be obtained with the Azure CLI: az account get-access-token --resource "https://vault.azure.net" The jsign --storetype AZUREKEYVAULT \
--keystore vaultname \
--storepass <tenantId>|<clientId>|<clientSecret> \
--alias test application.exe
If the The Azure account used must have the "Key Vault Crypto User" and "Key Vault Certificate User" roles. Signing with Azure Artifact SigningWith Azure Artifact Signing (formerly
Azure Trusted Signing) the The jsign --storetype TRUSTEDSIGNING \
--keystore weu.codesigning.azure.net \
--storepass <api-access-token> \
--alias <account>/<profile> application.exe
The access token can be obtained with the Azure CLI: az account get-access-token --resource https://codesigning.azure.net If the The Azure account used must have the "Code Signing Certificate Profile Signer" role. The certificates issued by Azure Artifact Signing have a lifetime of 3 days only, and timestamping is necessary to ensure the long term validity of the signature. For this reason timestamping is automatically enabled when signing with this service. Implementation note: Jsign performs an extra call to the signing API to retrieve the current certificate chain before signing. When signing multiple files it's recommended to invoke Jsign only once with the list of files to avoid doubling the quota usage. Signing with DigiCert ONE / DigiCert KeyLockerCertificates and keys stored in the DigiCert ONE Secure Software
Manager can be used directly without installing the DigiCert client tools. It requires an API key and a PKCS#12 keystore
holding a client certificate for the authentication. The US DigiCert ONE host is used by default
(https://clientauth.one.digicert.com) but a different host can be specified with the jsign --storetype DIGICERTONE \
--storepass "<api-key>|/path/to/Certificate_pkcs12.p12|<password>" \
--alias test application.exe
Signing with Encryption Consulting CodeSign Secure (Jsign 8.0 preview)When signing with Encryption Consulting CodeSign Secure,
the jsign --storetype CODESIGNSECURE \
--storepass "<username>|<password>|/path/to/client-certificate.p12" \
--keypass <client-certificate-password> \
--alias <keyname> \
application.exe
Signing with SSL.com eSignerWhen signing with the SSL.com eSigner service, the SSL.com username and password are used as the keystore password, and the base64 encoded TOTP secret is used as the key password: jsign --storetype ESIGNER \
--storepass "<username>|<password>" \
--alias 8b072e22-7685-4771-b5c6-48e46614915f \
--keypass <totp-secret> application.exe
SSL.com provides a sandbox environment, to use a test certificate simply add the parameter
Signing with GaraSignGaraSign is a remote signing service provided by Garantir.
The authentication is performed by specifying the username/password or the TLS client certificate in the
Authenticating with a username and a password: jsign --storetype GARASIGN \
--storepass "<username>|<password>" \
--alias test \
application.exe
Authenticating with a TLS client certificate and a non-default endpoint: jsign --storetype GARASIGN \
--keystore https://demo.garantir.io/CodeSigningRestService \
--storepass "/path/to/client-certificate.p12" \
--keypass <client-certificate-password> \
--alias test \
application.exe
Signing with Google Cloud KMSGoogle Cloud KMS stores only the private key, the certificate must be provided separately. The keystore parameter references the path of the keyring. The alias specifies the name and the version of the key: jsign --storetype GOOGLECLOUD \
--keystore projects/first-rain-123/locations/global/keyRings/mykeyring \
--storepass <api-access-token> \
--alias test/cryptoKeyVersions/1 \
--certfile full-chain.pem application.exe
The version of the key can be omitted (e.g. The access token is typically provided by the gcloud tool: gcloud auth print-access-token When creating the key the purpose must be set to "Asymmetric sign", and the algorithm must be either Elliptic Curve or RSA with PKCS#1 v1.5 padding and SHA digest. Keys with PSS padding or raw RSA mode are not supported. The Google Cloud account used must have the following permissions:
These permissions are covered by the Cloud KMS CryptoKey Signer and Cloud KMS Viewer roles. Signing with HashiCorp VaultHashiCorp Vault exposes keys through secrets engines. Jsign
supports the Google Cloud KMS and
Transit secrets engines. The jsign --storetype HASHICORPVAULT \
--keystore https://vault.example.com/v1/gcpkms \
--storepass <vault-token> \
--alias test:1 \
--certfile full-chain.pem application.exe
Signing with Keyfactor SignServerSignServer is a cloud/on-premises open source signing service developed by
Keyfactor. SignServer supports various signing operations handled by signer workers. Jsign requires a
Plain Signer
worker, preferably configured with the If necessary the authentication is performed by specifying the username/password or the TLS client certificate in the
Authenticating with a username and a password: jsign --storetype SIGNSERVER \
--keystore https://example.com/signserver \
--storepass "<username>|<password>" \
--alias test \
application.exe
Authenticating with a TLS client certificate: jsign --storetype SIGNSERVER \
--keystore https://example.com/signserver \
--storepass "/path/to/client-certificate.p12" \
--keypass <client-certificate-password> \
--alias test \
application.exe
Using server-side hashing, the digest algorithm must match the one configured for the worker: jsign --storetype SIGNSERVER \
--keystore https://example.com/signserver \
--alias "test|serverside" \
--alg SHA-512 \
application.exe
Signing with Oracle Cloud Key Management ServiceSigning with the Oracle Cloud Infrastructure Key Management Service requires the
configuration file or the
environment variables
used by the OCI CLI. The OCI CLI isn't required for signing, but it may be used to initialize the configuration file
with The The certificate must be provided separately using the The general syntax looks like this: jsign --storetype ORACLECLOUD \
--storepass "<oci-config-file>|<profile>" \
--keypass <passphrase> \
--alias ocid1.key.oc1.eu-paris-1.abcdefghijklm.abrwiljrwkhgllb5zfqchmvdkmqnzutqeq5pz7 \
--certfile full-chain.pem application.exe
When using the default configuration file and profile, the command is simplified to: jsign --storetype ORACLECLOUD \
--alias ocid1.key.oc1.eu-paris-1.abcdefghijklm.abrwiljrwkhgllb5zfqchmvdkmqnzutqeq5pz7 \
--certfile full-chain.pem application.exe
The configuration file can be replaced (or overridden) by environment variables. Here are the variables expected:
Signing with SignPathSigning with SignPath requires an account entitled to use the code signing gateway
and a signing policy configured for hash signing. The jsign --storetype SIGNPATH \
--keystore <organizationId> \
--storepass <accessToken> \
--alias <projectSlug>/<signingPolicySlug> \
application.exe
TaggingA signed file can be modified to include additional data without invalidating the signature. This feature is useful for embedding user identification data, such as a license key or a session token, within a signed installer when the file is downloaded. Upon installation, the installer extracts this data, enabling the application to automatically authenticate the user without requiring credentials. For example, to tag a signed installer with a license key: jsign tag --value userid:1234-ABCD-5678-EFGH installer.exe For an executable file, the tag can be found next to the timestamp of the signature, in the last few kilobytes of the file. A common pattern consist in embedding a default template at build time, providing enough space for the data to be inserted when the file is downloaded. This allows a simple search-and-replace operation to be performed on the download server without needing Jsign to be installed. For example: jsign tag --value "<TEMPLATE>XXXXXXXXXXXXXXXXXXXXXXXXXXX</TEMPLATE>" installer.exe If the Ant TaskHere is an example showing how to use Jsign with Ant. The parameters are the same as those described above for the command line tool (the long options only). <taskdef name="jsign" classname="net.jsign.JsignTask" classpath="jsign-7.6.jar"/>
<jsign file="application.exe"
name="My Application"
url="http://www.example.com"
keystore="keystore.jks"
storepass="password"
alias="test"
tsaurl="http://timestamp.sectigo.com"/>
The task also accepts a fileset to sign multiple files: <jsign keystore="keystore.p12"
storepass="password"
alias="test">
<fileset dir="build/binaries" includes="*.exe"/>
</jsign>
The <jsign command="tag" value="userid:1234-ABCD-5678-EFGH" file="application.exe"/> Maven pluginHere is an example showing how to use Jsign with Maven. The parameters
are the same as those described above for the command line tool (the long options only).
The execution is bound by default to the <build>
<plugins>
<plugin>
<groupId>net.jsign</groupId>
<artifactId>jsign-maven-plugin</artifactId>
<version>7.6</version>
<executions>
<execution>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<file>application.exe</file>
<name>My Application</name>
<url>http://www.example.com</url>
<keystore>keystore.jks</keystore>
<alias>test</alias>
<storepass>password</storepass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
It's possible to sign multiple files by using a ...
<configuration>
<fileset>
<directory>target</directory>
<includes>
<include>*.exe</include>
</includes>
</fileset>
<keystore>keystore.jks</keystore>
<alias>test</alias>
<storepass>password</storepass>
</configuration>
...
The value of the <configuration>
<file>application.exe</file>
<keystore>keystore.jks</keystore>
<storepass>{COQLCE6DU6GtcS5P=}</storepass>
</configuration>
The In <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
...
<servers>
<server>
<id>keystore</id>
<password>password</password>
</server>
</servers>
...
</settings>
And in the Maven project file, the password element references the server id prefixed with <configuration>
<file>application.exe</file>
<keystore>keystore.jks</keystore>
<storepass>mvn:keystore</storepass>
</configuration>
Gradle pluginHere is an example showing how to use Jsign with Gradle. The parameters are the same as those described above for the command line tool (the long options only).
Groovy
Kotlin
plugins {
id 'net.jsign' version '7.6'
}
task sign {
doLast {
jsign(file : 'application.exe',
name : 'My Application',
url : 'http://www.example.com',
keystore : 'keystore.p12',
alias : 'test',
storepass : 'secret',
tsaurl : 'http://timestamp.sectigo.com')
}
}
plugins {
id("net.jsign") version "7.6"
}
task("sign") {
doLast {
val jsign = project.extensions.getByName("jsign") as groovy.lang.Closure<*>
jsign("file" to "application.exe",
"name" to "My Application",
"url" to "http://www.example.com",
"keystore" to "keystore.p12",
"alias" to "test",
"storepass" to "secret",
"tsaurl" to "http://timestamp.sectigo.com")
}
}
The
Groovy
Kotlin
jsign(fileset : fileTree(dir: 'build', include: '**/*.exe'),
storetype : 'YUBIKEY',
storepass : '123456')
jsign("fileset" to fileTree("build") { include ("**/*.exe") },
"storetype" to "YUBIKEY",
"storepass" to "123456",)
GitHub ActionsJsign can be used in GitHub Actions by inserting the following steps in the workflow: steps:
[...]
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Download Jsign
run: wget https://github.com/ebourg/jsign/releases/download/7.6/jsign-7.6.jar
- name: Sign
run: >
java -jar jsign-7.6.jar --storetype TRUSTEDSIGNING
--keystore weu.codesigning.azure.net
--storepass ${{ secrets.AZURE_ACCESS_TOKEN }}
--alias <account>/<profile>
${{ github.workspace }}/dist/application.exe
APIJsign also provides a simple API for signing files and can be embedded in another application. Simply add this dependency to the project:
<dependency>
<groupId>net.jsign</groupId>
<artifactId>jsign-core</artifactId>
<version>7.6</version>
</dependency>
and then use the KeyStore keystore = new KeyStoreBuilder().keystore("keystore.p12").storepass("password").build();
AuthenticodeSigner signer = new AuthenticodeSigner(keystore, "test", "secret");
signer.withProgramName("My Application")
.withProgramURL("http://www.example.com")
.withTimestamping(true)
.withTimestampingAuthority("http://timestamp.sectigo.com");
try (Signable file = Signable.of(new File("application.exe"))) {
signer.sign(file);
}
A higher level API that mimics the command line tool is also available: (Jsign 8.0 preview) JsignTool.sign()
.keystore("keystore.p12")
.storepass("password")
.alias("test")
.name("My Application")
.tsaurl("http://timestamp.sectigo.com")
.execute(file);
JsignTool.tag().value("userid:1234-ABCD-5678-EFGH").execute(file);
JsignTool.extract().format("PEM").execute(file);
JsignTool.remove().execute(file);
See the Javadoc for more details about the API. JCA security providerJsign implements a JCA security provider that can be integrated with other Java based signing tools to extend their range of supported keystores. JAR signingThe JCA provider can be used to sign JAR files with the With Java 11 or later the syntax looks like this: jarsigner -J-cp -Jjsign-7.6.jar -J--add-modules -Jjava.sql \
-providerClass net.jsign.jca.JsignJcaProvider \
-providerArg <keystore> \
-keystore NONE \
-storetype <storetype> \
-storepass <storepass> \
-keypass <keypass> \
-certchain <certfile> \
application.jar <alias>
With Java 8 the classpath must reference jarsigner -J-cp -Jjsign-7.6.jar:$JAVA_HOME/lib/tools.jar \
...
The APK signingThe JCA provider can be used to sign Android applications with the java -cp apksigner.jar:jsign.jar com.android.apksigner.ApkSignerTool sign \
--provider-class net.jsign.jca.JsignJcaProvider \
--provider-arg <keystore> \
--ks NONE \
--ks-type <storetype> \
--ks-pass pass:<storepass> \
--ks-key-alias <alias> \
--key-pass pass:<keypass> \
--cert <certfile> \
--in application.apk
CreditsJsign leverages the cryptography API developed by the Bouncy Castle project. Jsign includes contributions from Emmanuel Bourg, Florent Daigniere, Michael Szediwy, Michael Peterson, Markus Kilås, Erwin Tratar, Björn Kautler, Joseph Lee, Maria Merkel, Vincent Malmedy, Sebastian Müller, Sebastian Stamm, Eatay Mizrachi and Alejandro González. ContactEmmanuel Bourg ([email protected], @ebourg.bsky.social) | ||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |