This section provides several PROSIGN command examples.

Sign an archive

The following example creates a signed archive named signeddemo.apl, based on the demo.apl archive. For demonstration purposes, the example uses additional pass-through jarsigner options for specifying a copy of the oepas1.p12 keystore with defsigkey alias and keystore password of password.

prosign --archive demo.apl --signedarchive signeddemo.apl --alias defsigkey 
--keystore oepas1.p12 --storepass password
The output from running the command is:
prosign       v0.08 (MSWin32)  Tue Mar 21 10:15:43 2023
signing of demo.apl ... OK
jar signed.

Warning:
The signer's certificate is self-signed.
Note: The warning message is a result of using a self-signed certificate.

Verify an archive

The following example verifies a signed archive file, signeddemo.apl.

prosign --verify --archive=signeddemo.apl --verbose --certs
The output from running the command is:
prosign       v0.08 (MSWin32)  Tue Mar 21 13:33:01 2023
META-INF/MANIFEST.MF in signeddemo.apl is Deflated
META-INF/DEFSIGKE.SF in signeddemo.apl is Deflated
META-INF/DEFSIGKE.RSA in signeddemo.apl is Deflated
signeddemo.apl contains 3 compressed files
verification of signeddemo.apl ... OK

s        490 Tue Mar 21 13:22:44 EDT 2023 META-INF/MANIFEST.MF

      >>> Signer
      X.509, CN=pasoe
      Signature algorithm: SHA256withRSA, 2048-bit key
      [certificate is valid from 3/26/21, 3:26 PM to 3/26/31, 3:26 PM]
      [Invalid certificate chain: PKIX path building failed: 
        sun.security.provider.certpath.SunCertPathBuilderException:
        unable to find valid certification path to requested target]

         323 Tue Mar 21 13:22:44 EDT 2023 META-INF/DEFSIGKE.SF
        1218 Tue Mar 21 13:22:44 EDT 2023 META-INF/DEFSIGKE.RSA
           0 Tue Mar 21 11:10:32 EDT 2023 META-INF/
           0 Fri Sep 23 15:42:26 EDT 2023 demo/rcode/
sm      1338 Fri Sep 23 15:42:26 EDT 2022 demo/rcode/HelloWorld.r

      >>> Signer
      X.509, CN=pasoe
      Signature algorithm: SHA256withRSA, 2048-bit key
      [certificate is valid from 3/26/21, 3:26 PM to 3/26/31, 3:26 PM]
      [Invalid certificate chain: PKIX path building failed: 
        sun.security.provider.certpath.SunCertPathBuilderException:
        unable to find valid certification path to requested target]


  s = signature was verified
  m = entry is listed in manifest
  k = at least one certificate was found in keystore

- Signed by "CN=pasoe"
    Digest algorithm: SHA-256
    Signature algorithm: SHA256withRSA, 2048-bit key

jar verified.

Warning:
This jar contains entries whose certificate chain is invalid. Reason: 
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
This jar contains entries whose signer certificate is self-signed.
This jar contains signatures that do not include a timestamp. Without a timestamp,
users may not be able to validate this jar after any of the signer certificates 
expire (as early as 2031-03-26).

The signer certificate will expire on 2031-03-26.