Skip to main content
Rugix Bakery 0.9.6 is here: Build rules for custom image pipelines and verified boot for EFI and Raspberry Pi. Read the release post.
Documentation

core/sign-cms

Create a CMS signature with an RSA key.

Preview
You're viewing the Next docs — a rolling preview of in-development changes. The current release docs may differ.

Create a CMS signature with an RSA key.

Inputs

content

Kind: file

Content to sign. The signature encapsulates it.

certificate

Kind: file

PEM-encoded RSA X.509 signer certificate.

Parameters

signing-time

Default: ""

Signing time as Unix seconds in a string (0..2524607999). Empty uses the build source epoch.

Outputs

signature

Kind: file

DER-encoded CMS SignedData with the encapsulated content and signer certificate.

Secrets

Required secret bindings: key. Secret changes invalidate cached outputs.

Execution

Environment

Rugix Bakery

Source epoch

Consumed

Output cache

Allowed

Behavior

Sign content with RSA PKCS#1 v1.5 and SHA-256. The certificate input is a PEM-encoded RSA X.509 certificate; the key secret contains its matching PEM-encoded private key. The signature embeds the content, the signer certificate, and a signing-time attribute. It includes no intermediate certificates.

signing-time is Unix seconds encoded as a string. An empty value uses the build source epoch. Accepted values range from 0 through 2524607999. Fixed inputs, key, signing time, and tooling produce identical signature bytes. Bind private keys through secrets so Bakery handles them as sensitive inputs.

This rule is the default signer of core/sign-bundle-rugix.

Example

For example, sign a file:

uses = "core/sign-cms"
inputs.content = { path = "metadata" }
inputs.certificate = { path = "keys/bundle.crt" }
secrets.key = { path = "keys/bundle.key" }
parameters.signing-time = "1700000000"

Save the invocation as build-rule.toml and run ./run-bakery bake rule build-rule.toml build/result.