CodeSafe 5 FAQ

Signing keys

What signing keys do I need for CodeSafe 5 application development?

Development requires the generation of the following keys:

  • A Developer ID key, which identifies your company or organization.

  • One Application Signing Key (ASK) for each application you intend to develop.

These keys should be kept in a Security World on an nShield HSM.

Can I use my existing CodeSafe signing key?

An existing seeinteg key can be used as an Application Signing Key if it is an ECDSA key using the NIST P521 curve. If not, a new ASK must be generated.

However, the csadmin image signextra command allows an existing seeinteg key to add additional signatures to a CodeSafe 5 application, which will permit that application to use existing working keys which are bound to that seeinteg key.

We strongly recommend that the Developer ID key be a newly-created Security World key, that has not been used to create signatures for other purposes. This must also be an ECDSA key using the NIST P521 curve. The key should be protected by an Operator Card Set.

Why do I see VerifyFailed messages after adding an extra signature?

If a CodeSafe 5 machine is already loaded on the HSM, adding an extra signature to its image using the csadmin image signextra command does not automatically reload the running machine.

If the machine continues to run with the previously loaded image, the newly added signature cannot be verified, and VerifyFailed messages may appear in the logs.

To avoid this, configure the hardserver to force a reload of the CodeSafe 5 machine when the image changes, for example, by enabling the force_reload setting in the hardserver configuration.

Can I use separate Security Worlds?

Yes. The Developer ID Key and the ASK do not need to share a Security World, and these do not need to be the same world deployed on the HSM which is running the application itself. All the signatures and the information required to verify them are contained within the .cs5 application file itself, except for the Developer ID certificate which is loaded separately into the certificate database.

Developer ID keys and Certificates

What is a Developer ID certificate, and how do I get one?

A Developer ID certificate is issued by Entrust nShield Technical Support to certify a Developer ID key as belonging to a particular organization.

The csadmin ids create command can create a new Developer ID key within a Security World, then generate a CSR (Certificate Signing Request), which is a short text file. You should then contact Technical Support and upload the CSR file.

Entrust will then send a signed Developer ID certificate (another short text file), which is needed during application development and deployment. This does not contain secret data; it identifies your organization but note we do not normally accept CSRs which include Personally Identifiable Information (PII).

Do Developer ID certificates need to be renewed?

Yes. Developer ID certificates issued by Entrust have a validity period of 3 years from date of issue, and will need to be renewed before this period expires.

This expiry period is to provide protection for the whole CodeSafe 5 ecosystem in the event that a Developer ID key is misused, and to allow organizations to exercise control over the lifespan of their keys and CodeSafe 5 applications.

What happens when a Developer ID certificate expires?

The Developer ID certificate’s validity is checked by the HSM when a CodeSafe 5 machine is loaded (using csadmin load), and when it is started (using csadmin start, or if auto-start is enabled). It is not checked at other times, so:

  • A CodeSafe 5 machine that is running will continue to run; it is not forcibly stopped when the certificate expires.

  • The machine itself is not deleted. Any data in its non-volatile storage, such as /home/codesafe in the container or data stored using the nCore NVMem APIs, is preserved.

  • Once stopped (either manually or through an HSM reboot), it cannot be restarted until a replacement certificate has been uploaded.

If the Developer ID key itself is not changed, there is no need to re-sign the CodeSafe machine image or re-load its .cs5 file. The replacement certificate will identify the same signing key and developer identity, just with a later expiry date.

Loading an updated Developer ID certificate is done via the csadmin ids add command. This can be done at any time (including while the machine is running). The HSM allows multiple certificates for the same Developer ID key in its database, and will accept whichever certificate is currently valid.

The expected usage is that, at any time before the expiry of the current Developer ID certificate, you run csadmin ids create to create a new CSR for the existing key, and obtain a new certificate from Entrust Support. This can be uploaded at a convenient time, and when this is done the old certificate can be removed. There is no system downtime required to complete this process.

Why might I not renew a Developer ID certificate?

You may wish to allow a Developer ID certificate to expire if:

  • You suspect that the Developer ID key could have been misused, for instance to sign an ASK which is not under your control.

  • You have improved the security (e.g. process or physical security) around handling of such keys, and wish to use a new key which uses these arrangements.

  • You wish to ensure old versions of your CodeSafe 5 applications can no longer be run.

Version and feature compatibility

CodeSafe 5 features are delivered across components that are versioned and signed independently of each other:

  • The HSM firmware (the PCIe module firmware). This is the only component that carries FIPS approval. The latest FIPS-approved firmware is v13.4.5. Firmware v13.8.4 is a FIPS-pending release.

  • The host-side software, consisting of the Security World software, the CodeSafe SDK, and, for the nShield 5c, the appliance image (a separately signed artifact). These components can be updated independently of the FIPS-approved firmware.

Because the firmware and the host-side software are versioned separately, a feature can require a minimum version of either component, or both. Customers who must remain on FIPS-approved firmware (v13.4.5) can still update the host-side software and SDK to gain any feature that does not require newer firmware.

The IPC daemon, the SEElib library, and the libnfstub.a and libnfkm.a libraries work on v13.4.5 firmware. This enables applications that use these libraries to be built for and run on the FIPS-approved firmware.

Feature Minimum firmware Minimum host-side (SecWorld / CodeSafe SDK / 5c image) Notes

CodeSafe 5 (baseline)

v13.4.5

v13.4.3

First CodeSafe 5 release. v13.4.5 firmware is the latest FIPS-approved firmware.

Expanded system-call set for general-purpose development

v13.7.1

v13.4.3

A small number of additional system calls were allowed in v13.5.1 firmware, and the majority added in v13.7.1 firmware. This is a firmware change, so it takes effect with newer firmware regardless of the host-side version. See System calls allowed by CodeSafe 5 applications for the full allowed list, including the firmware version in which each call was first allowed.

Python 3.11 applications

v13.5.1

v13.6.3

Note that nfpython / nfkm modules for Python were not introduced in the SDK until v13.9.5 (see below). The Python 3.11 interpreter, local file I/O, and the nfpython / nfkm modules work on v13.4.5 firmware provided a v13.9.5 or later CodeSafe SDK is used. Sockets are not supported on v13.4.5 firmware with any SDK later than v13.4.3. Original v13.4.3 shipped Python 3.8 in its SDK, but lacked nfpython / nfkm.

Turnkey auto-load ([codesafe] config / hsc_codesafe)

v13.4.5

v13.7.3

Core auto-load works against v13.4.5 firmware. On a 5c, initial launcher client-key enrollment on firmware earlier than v13.8.0 has a Maintenance-mode caveat; see the 5c launcher client-key enrollment without Maintenance mode entry below. See Automatic Configuration of CodeSafe 5 Applications via the Host Machine.

Extra image signatures beyond the ASK (csadmin image signextra)

v13.7.1

v13.7.3

See Create and sign CodeSafe 5 applications with csadmin.

Offline signing (Developer ID and ASK sign separately)

v13.4.5

v13.9.4

The Developer ID key signs a delegation for the Application Signing Key up front (csadmin image presignask, then csadmin image signask), after which images can be signed with the ASK alone (csadmin image sign --signedask). This is a host-side split of the signing workflow and works with v13.4.5 firmware; the minimum host-side version shown is the one that provides the tooling. See Offline signing using the Developer ID key.

ASK may be a seeinteg key

v13.4.5

v13.9.4

Works from v13.4.5 firmware onwards: the change is in host-side metadata, not the underlying nCore key representation.

Deterministic CodeSafe 5 builds

Not applicable

v13.9.4

Host-side / SDK tooling only.

5c launcher client-key enrollment without Maintenance mode

v13.8.0

v13.9.4

The appliance-cli client-key enrollment commands (cs5 getclientinfo, cs5 setclientinfo, and cs5 clearclientinfo) access the launcher client key. On firmware versions earlier than v13.8.0, these commands temporarily switch the module into Maintenance mode and are therefore not recommended for live-deployed systems. From v13.8.0 they run without Maintenance mode. See nShield 5c CodeSafe 5 Configuration.

Generic Stub (NFastApp) and NFKM C APIs, and their Python equivalents

v13.4.5

v13.9.5

These intentionally support v13.4.5 firmware, so that applications that use them can be built for and run on the FIPS-approved firmware. The Python equivalents (nfpython, including nfkm) also work on v13.4.5 firmware, because they reach the HSM through the in-container IPC daemon rather than through TCP/IP sockets.

C++ support (formalized)

v13.4.5

v13.9.5

C applications run on v13.4.5 and later firmware. C17 applications built with the current SDK are supported on v13.4.5 firmware, including language features such as exceptions, RTTI, threads and synchronization primitives, filesystem and streams, chrono and async.

Auto-load from the 5c RFS

v13.4.5

v13.9.5

Moves the auto-load function into the appliance itself, so it is not firmware-dependent. See Auto-Load Configuration of CodeSafe 5 Applications via the nShield 5c.

CodeSafe 5 image encryption

v13.8.6

v13.9.6

Encrypted images cannot be loaded on earlier firmware. See Encrypt a CodeSafe 5 image.

SSH hybrid post-quantum key exchange

v13.8.6

v13.9.6

Negotiated automatically; falls back to the classical key exchange against earlier firmware. See Environment variables for the NCSSH_KEY_EXCHANGES variable.