SBOM Attestations: How to Sign and Verify

Reference guide

From signing to verification, step by step.

An attestation is a signed statement that says "this SBOM describes this exact artifact". This guide walks through the four messages involved, explains each field in plain language, and lists what to check before you trust the result.

How it works

Four messages, one chain of trust

The producer signs once. Each consumer checks the signature and compares the artifact they actually have with the one that was signed. Select a step to see it below.

What is inside an attestation

Signed envelope A small JSON wrapper holding the signed content (payload), its type label (payloadType) and the signature (signatures). The signature covers the content and its type label together.
Statement The signed content: "this SBOM describes this artifact". It is stored in one exact, canonical form so the signature always checks out.
Subject: the artifact Its name and SHA-256 fingerprint. This is what ties the SBOM to one exact build.
Predicate: the SBOM Your CycloneDX, SPDX or AI-SBOM document, exactly as you sent it.
Extra SBOM signature (optional, off by default) Only needed if the SBOM must be checked on its own after it is taken out of the attestation.

Explorer

Real requests and responses, explained

These are real messages from POST /api/v2/attestations/sign and POST /api/v2/attestations/verify. Select a numbered field to see what it means and what to check.

Checklists

What to check, message by message

1 · Sign request

Before you sign

  • Use a key created with key_type: "attestation". A normal SBOM signing key is rejected with key_purpose_mismatch.
  • The fingerprint in subject[].digest.sha256 is the SHA-256 of the artifact (an image, binary or package), not of the SBOM.
  • subject[].name is the name people will look the artifact up by, such as an image reference.
  • Send sbom as a JSON object, not a string, and make sure it isn't already signed.
  • Leave out predicate_signature unless the SBOM must also be checkable on its own.

2 · Sign response

Before you publish

  • Store and share attestation exactly as returned. Re-formatting the payload breaks the signature.
  • Decode the payload and confirm the artifact name and fingerprint are the ones you meant to sign.
  • predicate_type matches your SBOM format (CycloneDX, SPDX or AI-SBOM).
  • signatures[0].keyid equals your key_id.
  • Keep statement_sha256 with your build records. Verification returns the same value.

3 · Verify request

Before you verify

  • Compute expected_digest.sha256 yourself from the artifact you are about to use. Never copy it from the attestation, or the check proves nothing.
  • Send attestation as a JSON object, not in quotes and not wrapped in another field.
  • Use the key_id of the producer you expect. A different signer fails with key_mismatch.

4 · Verify response

Before you trust it

  • Act only on verified: true. A failure returns an error code naming the first check that failed.
  • matched_subject is the artifact your fingerprint matched. Confirm the name is the one you expect.
  • key_type is attestation, and predicate_type is the SBOM format you expect.
  • checks.predicate_signature: "not_present" is normal. It means no extra SBOM signature was requested.
  • statement_sha256 equals the value from the sign response.

Try it

Change the attestation and watch verification fail

This runs the same checks as SecureSBOM, entirely in your browser. Nothing is uploaded. Edit the decoded payload or press a "change" button, then run the checks again.

The public key is the example producer's, published at GET /api/v1/public/keys/{key_id}. Checking against the producer's own key proves both that nothing changed and who signed it.

Change something

Run the checks to see the result.

    SecureSBOM stops at the first failure and returns its error code. This page runs every check, so you can see everything that broke.

    Troubleshooting

    Verification error codes

    CodeWhat it meansWhat to do
    expected_digest_requiredNo artifact fingerprint was sent.Hash the artifact you are about to use and send that SHA-256.
    invalid_envelopeThe attestation isn't in the expected format.Send it as a JSON object, unchanged, with payloadType, payload and signatures.
    key_mismatchA different key signed it.Check which producer you expect, and compare with signatures[].keyid.
    signature_invalidThe signature doesn't match the content.Something changed after signing. Get the original attestation again.
    payload_not_canonicalThe signed content was re-formatted.Something re-saved it, for example by pretty-printing. Use the original.
    invalid_statementThe statement is missing required parts.Check _type, subject, predicateType and predicate.
    unsupported_predicate_typeThe SBOM isn't CycloneDX, SPDX or AI-SBOM.Confirm the attestation came from a supported SBOM format.
    subject_mismatchYour artifact's fingerprint isn't in the attestation.You have a different artifact from the one that was signed. Don't use it.
    predicate_signature_invalidThe optional extra SBOM signature doesn't match.The SBOM changed, or the wrong separate signature was sent.

    For the curious

    The standards behind it

    You don't need these to use attestations, but they help if you are building your own verifier or reviewing the design.

    DSSE (Dead Simple Signing Envelope)
    The format of the signed envelope. The signature covers the content together with its type label, so neither can be swapped for another.
    in-toto Statement
    A widely used format for "this data describes that artifact". The artifact is the subject and the SBOM is the predicate.
    Canonical JSON (RFC 8785)
    One fixed way of writing JSON (sorted keys, no extra spaces), so the same data always produces the same bytes and the same signature.
    ES256
    The signature algorithm: ECDSA with the P-256 curve and SHA-256.
    SHA-256 fingerprint (digest)
    A 64-character hash that identifies one exact file or image. Change a single byte and it changes completely.

    Take it with you

    Get the PDF checklist

    Request a printable copy of this guide for your team. We'll send it to you, and we can help you add attestation signing to your pipeline.