Plain Signer

The Plain signer can sign arbitrary data and simply produces a signature in the format determined by the configured signature algorithm.

Fully qualified class name: org.signserver.module.cmssigner.PlainSigner

Overview

To download a sample configuration file for this Worker, see Sample Worker Configurations.

For information on the interfaces this Worker can be called through, see Supported Interfaces by Worker.

For a guide on signing code with a Plain Signer, see Code Signing with Plain Signatures.

For a guide on signing code with client-side hashing using a Plain Signer, see Code Signing with Client-side Hashing.

Available Properties

The following table lists and describes the available properties for the Plain Signer:

Property

Default

Description

ACCEPTED_HASH_DIGEST_ALGORITHMS

None

Comma-separated list of accepted hash digest algorithms. When a request is consisting of a pre-computed hash, the requested digest algorithm must be among the values specified in this property.

The property does not have a default value and must be specified if client-side hashing is set as the default, or if overriding via the request is allowed.

ALLOW_CLIENTSIDEHASHING_OVERRIDE

False

Property specifying if the request is allowed to override the behavior defined via CLIENTSIDEHASHING as to if the request data is to be considered the actual data to be signed or a pre-computed hash.

With this option set to true, it is possible for the client to include the request parameters USING_CLIENTSUPPLIED_HASH=true and CLIENTSIDE_HASHDIGESTALGORITHM and only send in the hash value and make the signer take care of proper encoding of the signature.

CLIENTSIDEHASHING

False

Property specifying if the request data should be considered to be a pre-computed (by the requesting client) hash. If this is set to true, ACCEPTED_HASH_DIGEST_ALGORITHMS must be defined. Default: False.

With this option set to true, the input to the signer should be the hash value and the request parameter CLIENTSIDE_HASHDIGESTALGORITHM must also be provided.

DO_LOGREQUEST_DIGEST

True

Property specifying if the message digest of the requested document should be put in the log.

LOGREQUEST_DIGESTALGORITHM

SHA256

Property specifying the algorithm used to create the message digest (hash) of the request document to put in the log.

NOCERTIFICATES

False

Set to true in order to not require a signer certificate to be installed for this signer to become ACTIVE and able to create signatures. Supported since 7.4.0.

See also general information about this property under Common Worker Configuration.

As the signer certificate (if any) will not be provided in the status output or status properties but instead the PEM encoded public key is available in the status output under the "Public key" section. The status output is formatted so it may be required to trim white spaces from within the PEM block before some tools will be able to parse it.

SIGNATUREALGORITHM

Depends on the signing key

Property specifying the algorithm used to sign the data. Default value depends on the signing key:

  • SHA256withDSA for DSA keys

  • SHA256withECDSA for ECDSA keys, Ed25519 or Ed448 for EdDSA keys

  • SHA256withRSA for all other keys

The default value can also depend on if Client-Side Hashing is used. If a signing key is used together with client-side hashing with no set signature algorithm, RSA and ECDSA keys default to NONEwithRSA and NONEwithECDSA respectively.

Client-Side Hashing

For Client-Side Hashing, use one of the NONEwith... signature algorithm values and either use CLIENTSIDEHASHING=true or ALLOW_CLIENTSIDEHASHING_OVERRIDE=true, or alternatively make sure the input is encoded in the expected way for the chosen signature algorithm.

For NONEwithRSA (RSASSA-PKCS1-v1.5) specifically, ensure that the required properties are set. If these properties are not configured, the input should adhere to a DER encoded DigestInfo structure as outlined in RFC#3447, page 42, which provides examples. Alternatively, if the DigestInfo/ASN.1 structure is not desired, it can be omitted when invoking the signer. Note that this is the legacy way of configuring client-side hashing with the plain signer. As of SignServer 5.9, it is recommended to instead use one of the CLIENTSIDEHASHING and ALLOW_CLIENTSIDEHASHING_OVERRIDE properties, as the client then does not have to care of any special encoding.

The other NONEwith... signature algorithms are all supported by this signer provided that:

  • One of the CLIENTSIDEHASHING and ALLOW_CLIENTSIDEHASHING_OVERRIDE properties are set to true.

  • The client includes the request parameters.

  • The underlying crypto token supports the algorithm.

In this case, the input data should be the hash value without any special encoding.

Currently, the PKCS#11 Crypto Token relying on Java support for PKCS#11 does not support NONEwithRSAandMGF1 (RSASSA-PSS) while the P11NG Crypto Token supports this algorithm. For more information, see PKCS11CryptoToken Algorithm Support and P11NG Crypto Token Algorithm Support.

ML-DSA External μ

Enterprise

When using client-side hashing with ML-DSA, External μ is used, which can either be calculated on the client-side, using SignClient, or provided directly to be signed. ML-DSA External μ can be used explicitly or implicitly, similar to client-side hashing, where the signature algorithm should be set to ML-DSA-EXTERNAL-MU alongside the other required parameters for performing the signing request:

Explicit ML-DSA External μ:

Implicit ML-DSA External μ:

  • CLIENTSIDEHASHING and ALLOW_CLIENTSIDEHASHING_OVERRIDE are both configured to false in the Plain Signer.

  • Implicitly signing the μ bytes requires the length of μ to be 64 bytes. The key performing the signing request must be an ML-DSA private key, where its corresponding public key was used to create μ for the resulting signature to be correct.

Request Parameters

The following meta data parameters can be specified in a request

Property

Description

CLIENTSIDE_HASHDIGESTALGORITHM

The hash digest algorithm of the pre-computed hash.

USING_CLIENTSUPPLIED_HASH

If this property is set and defined as true, treat the request data as a pre-computed hash. This requires the CLIENTSIDE_HASHDIGESTALGORITHM meta data property to be set and is only allowed if either the signer is configured by default to assume client-side hashing, or if overriding is allowed.

Worker Log Fields

Field

Description

REQUEST_DIGEST

A message digest (hash) for the request document in hex encoding.

REQUEST_DIGEST_ALGORITHM

The name of the message digest (hash) algorithm used for the request digest in the log.

RESPONSE_ENCODED

The response document (plain signature) in base64 encoding.