core/sign-efi
Sign a PE executable for UEFI Secure Boot.
Sign a PE executable for UEFI Secure Boot.
Inputs
-
image -
Kind: file
PE executable to sign, such as a UKI or bootloader.
-
certificate -
Kind: file
PEM-encoded RSA X.509 signing certificate.
Parameters
-
signing-time -
Default:
""Signing time as Unix seconds in a string (0..2524607999). Empty uses the build source epoch.
Outputs
-
image -
Kind: file
PE executable with a UEFI Secure Boot signature.
Secrets
Required secret bindings: key. Secret changes invalidate cached outputs.
Execution
-
Environment
-
Rugix Bakery
-
Source epoch
-
Consumed
-
Output cache
-
Allowed
Behavior
Sign a PE executable, such as a UKI or bootloader, with RSA and SHA-256 using
osslsigncode. The certificate input is a PEM-encoded RSA X.509 certificate;
the key secret contains its matching PEM-encoded private key. The rule
verifies the resulting signature before exporting image.
signing-time is Unix seconds encoded as a string. An empty value uses the
build source epoch. EFI signing accepts values from 0 through 2524607999.
Fixed inputs, key, signing time, and tooling produce identical signed bytes.
Bind private keys through secrets so Bakery handles them as sensitive inputs.
The device’s firmware must trust the signing certificate. Certificate enrollment and firmware trust configuration are separate provisioning steps.
This rule is the default efi-signer of
core/image-efi-verified, which accepts other
signers, for example HSM-backed ones.
Example
For example, sign a prepared UKI:
uses = "core/sign-efi"
inputs.image = { path = "boot.efi" }
inputs.certificate = { path = "keys/boot.crt" }
secrets.key = { path = "keys/boot.key" }
parameters.signing-time = "1700000000"
Save the invocation as build-rule.toml and run
./run-bakery bake rule build-rule.toml build/result.