A plain signature is the simplest signature format in SignServer. The plain signature is the raw output bytes of the chosen signature algorithm, with no embedded certificate, public key, or original document.
This makes it useful in situations where the receiver already has access to the certificate or public key through another channel. For example, in firmware on embedded devices, it could be that a list of trusted certificates or public keys is pre-installed, or as part of a custom protocol that encodes certificates separately.
Plain Signer Configuration Properties
The following property is the most relevant when configuring the Plain Signer:
|
Property |
Description |
|---|---|
|
|
The algorithm used to sign the data. Example: |
For all available properties, see Plain Signer.
Supported signature algorithms include:
-
ECDSA:
SHAxWithECDSA,NONEwithECDSA -
RSA:
SHAxWithRSA(RSASSA-PKCS1_v1.5),SHAxWithRSAandMGF1(RSASSA-PSS),NONEwithRSA -
ML-DSA: Pure
ML-DSA-<44/65/87>,ML-DSA-EXTERNAL-MU -
SLH-DSA: Pure
SLH-DSA <SHA2/SHAKE>(hash function)<128/192/256>(size specification)<f/s>(fast or small)
Supported cryptographic hash functions can be SHA-1, SHA-256, SHA-384, and SHA-512, and so on. For information on using the signature algorithms NONEwithRSA and NONEwithECDSA, refer to Client-side Hashing and RFC#3447.
For more supported algorithms, see Plain Signer Algorithm Support.
Set up the Plain Signer
Step 1 - Add and Configure the Signer
-
Click Add and select From Template.
-
Choose plainsigner.properties and click Next.
-
Click Apply.
-
Select the Worker named PlainSigner from the list.
-
Click the Configuration tab and update the following properties:
-
NAME: Set a descriptive name for the worker.
-
CRYPTOTOKEN: set this to match your Crypto Token.
-
-
Click the Status Summary tab, and click Renew Key.
-
Select a Key Algorithm (for example,
RSA) and Key Specification (for example,2048), and click Generate.
Step 2 – Generate a CSR and Install the Certificate
If you set the NOCERTIFICATES property to true, the Plain Signer does not require a certificate. Skip this step and confirm the Worker status is Active.
-
Click Generate CSR.
-
Choose a Signature Algorithm, such as
SHA256withRSA, and enter a Subject DN for the new certificate such asCN=Plain Signer Test,O=My Company, C=SE. -
Click Generate.
-
Click Download and save the CSR file.
-
Submit the CSR to your Certificate Authority. The CA returns the signed certificate and any CA certificates in the chain.
Before installing certificates in a production system, verify the Signer authorization settings. Once certificates are installed, the signer will be fully functional and ready to receive requests.
-
Click Install certificates. Provide the Signer certificate first and then add the issuing CA certificates in order.
-
Click Add to append the certificates to the chain.
-
When all certificates have been added in the correct order, click Install.
-
Confirm the Worker status is Active. If not, check the Status Summary page for errors.
Sign a File
You can submit files for signing using the Client Web, the SignClient, or HTTP clients like cURL.
Using Client Web
To upload a file and create a detached signature for it, perform these steps:
-
Go to the SignServer Client Web Generic page.
-
Scroll down to the Generic Signing Or Validation by File Upload section and specify
PlainSignerin the Worker Name field. -
Click Choose File, select the file to create a detached signature for, such as
release.zip.
-
Click Submit.
-
Save the resulting signature file, for example,
release.zip.asc.
Using SignClient
Send a signing request using the SignServer SignClient:
bin/signclient signdocument -workername PlainSigner1 -infile firmware.bin -outfile firmware.sig
Where workername is the name of the Worker, infile is the path to the file to sign, and outfile is where the signature will be written to.
The SignClient can also run (as User) in batch mode, which processes all files in an input directory across parallel threads and writes results to an output directory:
bin/signclient signdocument -workername PlainSigner1 -indir ./input/ -removefromindir -outdir ./output/ -threads 10
Using cURL
Replace http://localhost:8080/ with the address of your server or appliance:
curl -F "workerName=PlainSigner1" -F "file=@firmware.bin" \
http://localhost:8080/signserver/process > firmware.sig
The following shows the HTTP traffic between the browser and the server, and the resulting signature file response:
Verify the Signature
Use the OpenSSL dgst command to verify a plain signature. The command requires the public key, so it must first be extracted from the certificate:
openssl x509 -in plainsigner1.pem -noout -pubkey > plainsigner1-pubkey.pem
openssl dgst -signature firmware.bin.sig -verify plainsigner1-pubkey.pem -sha1
firmware.bin
Verified OK
Replace -sha1 with the digest algorithm used as part of the signature process, for example -sha256.