Skip to main content

    Code Signing Key Attestation: Using Your Own HSM

    Key attestation is how a CA proves your code signing key was generated inside your own HSM. The seven accepted methods, and what to do without one.

    DR
    Daniel Rehak
    ·
    12 min read
    ·
    Published September 23, 2026
    ·
    Last updated September 23, 2026

    The short answer

    Key attestation is a statement signed by your own hardware, using a key its manufacturer installed at the factory, confirming that the private key in your certificate request was generated inside that device and cannot be exported from it. Since June 1, 2023 every publicly trusted code signing certificate requires the key to sit in a module certified to at least FIPS 140-2 Level 2 or Common Criteria EAL 4+, and section 6.2.7.4.2 of the Code Signing Baseline Requirements gives a CA seven ways to verify that. Attestation is the method that lets you use hardware you already own. If your module cannot produce one, three of the remaining six methods — an IT audit, a cloud subscription report, or an auditor who watched the key ceremony — were written for exactly that situation.

    One practical note before the detail: the verification route is fixed when the order is placed, not afterwards, so it is worth knowing which routes a CA supports before you pay. If you are still choosing, compare the code signing certificates we sell and what each one does about key storage.

    How key attestation lets hardware vouch for a private key it will never releaseA left-to-right flow in three stages. Stage one, your hardware security module or token: the key pair is generated inside the device and the private key is marked non-exportable, so it never appears anywhere else. Stage two, what leaves the device: a certificate signing request carrying the public key and your organisation name, and alongside it, highlighted in gold, an attestation signed with a key the manufacturer installed at the factory. Stage three, what the certifying authority checks: that the attestation chains to the manufacturer's own root, that it names a non-exportable key, and that the module model appears on a FIPS or Common Criteria certificate. A band across the bottom states that the private key appears in none of these messages, which is the point, and that a certificate signing request on its own proves possession of a key but says nothing about where that key is stored.The key never leaves, so the hardware testifies instead1. Inside your moduletoken, on-prem HSMor dedicated cloud HSMkey pair generatedhere, not importedprivate key flaggednon-exportable2. What you sendCSRpublic key + your nameattestationsigned by a factory keyyou cannot forge3. What the CA checksit chains to themanufacturer's rootit names anon-exportable keythe model holds a FIPSor Common CriteriacertificateThe private key appears in none of these messages.A CSR proves you hold a key. It says nothing about where that key is kept,which is the only thing the code signing rules care about since 1 June 2023.The attestation is the part that closes that gap.
    Read the middle column twice. The CSR and the attestation answer two different questions, and a request rejected for "missing attestation" is nearly always a perfectly valid CSR that answered only the first one.

    What key attestation actually is

    An attestation is the hardware speaking for itself. Every compliant token or HSM ships with a key pair burned in during manufacture, along with a certificate for it signed by the vendor. When the device generates a new key pair for you, it can sign a short statement about that key — this key was created here, inside this module, with the export flag off — using the factory key. You cannot produce that signature yourself, and neither can anyone holding a copy of your private key on a laptop, which is precisely what makes it evidence.

    The Code Signing Baseline Requirements describe the mechanism without much ceremony. Method 2 of section 6.2.7.4.2 is "the Subscriber counter-signs certificate requests that can be verified by using a manufacturer's certificate, commonly known as key attestation, indicating that the Private Key was generated in a non-exportable way using a suitable Hardware Crypto Module". The phrase "commonly known as key attestation" sits in the standard itself, which is unusual and tells you how settled the practice had become before the Forum wrote it down.

    What reaches the CA is therefore two files rather than one: the certificate signing request, and an attestation bundle whose format depends entirely on the vendor. A YubiKey emits a small certificate chain from its PIV applet. A Thales or Entrust HSM produces something structurally different. The CA reads whichever it supports, checks the chain back to a vendor root it already holds, and looks at what the statement claims about exportability.

    Why your word is not enough

    Because a CSR cannot carry the claim. A certificate signing request proves one thing: that whoever assembled it holds the private key matching the public key inside, because the request is signed with that key. Where the key is stored leaves no trace in it. A key generated in a FIPS-validated HSM and a key generated by OpenSSL into a file on a shared build server produce CSRs that are indistinguishable to the CA.

    That gap did not matter much until the hardware mandate landed on June 1, 2023, when the Forum made hardware protection compulsory for OV code signing as well as EV. Once the requirement exists, the CA needs a way to check it, and the only honest options are to supply the hardware itself, get the hardware to testify, or get a human to testify that they watched. Those three ideas are what the seven methods reduce to.

    The pressure behind the rule is worth remembering when the paperwork feels heavy. Signing keys that sat in files were stolen and used to sign malware that inherited the publisher's good name, and the damage in those cases falls on users who had no way to tell. The rules also bite afterwards: section 4.2.2 bars a CA from issuing a new code signing certificate to an entity it knows has breached the key protection requirements, or that has been the victim of two takeover attacks, unless a software supplier expressly authorises it.

    The seven methods a CA may use

    Section 6.2.7.4.2 lists seven ways to satisfy the requirement and says one of them must be employed. They are not alternatives you pick from a menu at checkout. The CA decides which it supports and documents that in its certification practice statement, so your real choice is the overlap between this list and the practices of whichever CA you are buying from.

    The seven verification methods of section 6.2.7.4.2 grouped into three practical routes by who produces the evidenceThree columns. The left column, the CA does it, holds method one: the certifying authority ships hardware carrying key pairs it generated itself, so no evidence is asked of the subscriber. The middle column, highlighted in gold and headed you prove it, holds five methods: method two, a counter-signed request verified against a manufacturer's certificate, commonly known as key attestation; method three, a CA-prescribed crypto library used with a suitable module; method four, an internal or external IT audit; method five, a report from a cloud-based key protection subscription; and method six, a report signed by an auditor approved by the CA who witnessed the key generation ceremony. The right column, someone else holds the key, carries method seven: an agreement that the subscriber uses a Signing Service meeting section 6.2.7.3. A band across the bottom notes that the rules require one of the seven to be employed but leave the choice of which ones to support with the certifying authority.Seven methods, three routes, one question: who produces the proof?CSBR 6.2.7.4.2 — Subscriber Private Key verificationThe CA does it1. CA ships hardwarewith key pairs itgenerated itselfnothing to prove,nothing to chooseyou wait for acourier insteadYou prove it2. key attestationmanufacturer's certificate3. CA-prescribed library4. internal or external IT audit5. cloud subscription report6. approved auditor witnessesthe key generation ceremonyfive ways to answer the samequestion about your hardwareSomeone else holds it7. an agreement thatyou use a SigningService under 6.2.7.3the evidence burdenmoves to the operatorand its auditors,not your deskOne of the seven MUST be employed — but the CA decides which ones it supports.Your real menu is the intersection of this list and that CA's practice statement.
    The middle column is the one worth reading slowly. Four of those five methods exist precisely because plenty of compliant hardware cannot produce an attestation file, and buyers who assume method 2 is the only door give up too early.
    MethodWhat the CSBR saysWhat it means for you
    1The CA ships hardware carrying key pairs the CA generated on itThe classic token in the post. No evidence asked of you, and no key you generated yourself.
    2A counter-signed request verifiable against a manufacturer's certificate — key attestationYour hardware, your key, an attestation file submitted with the CSR.
    3A CA-prescribed crypto library used with a suitable moduleYou generate the key through the CA's own tool, which vouches for the pairing.
    4An internal or external IT audit that you generate code signing key pairs only in a suitable moduleA process-level answer rather than a per-key one. Common in enterprises that already hold audit reports.
    5A report from the cloud key protection subscription and its resource configurationFor a dedicated cloud HSM you rent: the console's own evidence of how the key is configured.
    6A report signed by an auditor the CA approves, who witnessed the key generationThe human fallback. Slow and billable, and the route that rescues hardware with no attestation support.
    7An agreement that you use a Signing Service meeting section 6.2.7.3Cloud signing. You sign a contract; the operator carries the evidence burden.

    Notice what methods 4, 5 and 6 have in common. None of them asks the hardware to speak. They let a person or a console describe the arrangement instead, which is why a compliant HSM with no attestation interface is an inconvenience rather than a dead end.

    Does the hardware you already own qualify?

    Two conditions have to hold at once, and buyers usually check only the first. The module must carry a certification at FIPS 140-2 Level 2 or Common Criteria EAL 4+ or better, per section 6.2.7.4.1, and the specific CA you are buying from must accept that model through a method it supports. A drawer full of certified hardware is no use if the CA's process only knows how to read attestations from two vendors.

    The device most often brought to this conversation is a YubiKey, and the answer turns on the model. The YubiKey 5 FIPS Series holds a FIPS 140-3 validation at overall Level 2 with Physical Security evaluated at Level 3 — Yubico announced the upgraded series in May 2026 under certificate #5291 — which clears the floor, and its PIV applet can attest to a key it generated. Sectigo documents the enrolment path for customer-owned YubiKeys directly. A standard, non-FIPS YubiKey holds no such validation and does not qualify, regardless of how similar the hardware feels in the hand.

    For larger modules the same two-part question applies: Luna network HSMs, comparable on-premises appliances and dedicated cloud HSM tiers are routinely accepted, and the friction is rarely the certificate — it is whether the CA has an intake path for that vendor's attestation format. Check the module's certificate number against the validation programme's own list rather than the datasheet, because vendors frequently validate one firmware revision out of several sold under the same product name. If the standard behind your module has been on your mind lately, the FIPS 140-2 move to NIST's Historical list changed which modules a federal buyer may cite in new procurement, and nothing about whether your token still satisfies this clause.

    When your HSM cannot attest

    You fall back to a human or a report. Method 6 is the one CAs have productised: an auditor the CA approves watches the key generation ceremony and signs a letter describing what they saw. SSL.com publishes this as Bring Your Own Auditor and lists what the letter must state — that the key was generated in a module certified to at least FIPS 140-2 Level 2, that the module was operating in that mode, that the private key is marked non-extractable and sensitive under PKCS#11, that authentication is required for every use of the key, and that the auditor was present for the entire ceremony with no sign of compromise.

    The auditor cannot be a colleague you trust. The CA sets the bar, and SSL.com's wording asks for a certification path from an established security body — the CSBR itself speaks of an auditor approved by the CA with IT and security training, or a CISA. Budget for a scheduled appointment and a professional fee, and for the fact that the ceremony has to happen before the certificate can be issued rather than alongside it.

    Method 4, the IT audit route, is quieter and often cheaper for organisations that already sit inside an audit regime. It answers at the level of practice — this company generates code signing key pairs only in suitable modules — rather than per key, so it suits a team issuing several certificates a year. Ask the CA which report formats it accepts before commissioning anything, because a report written for a different framework may not map onto what the CA needs to see.

    The route that skips attestation entirely

    Method 7 removes the question from your side of the table. Sign an agreement that you will use a Signing Service meeting section 6.2.7.3, and the key is generated and held inside the operator's module, evidenced by the operator's audit rather than by anything you produce. No attestation file, no ceremony, no auditor invoice. Certum's SimplySign, SSL.com's eSigner and DigiCert's KeyLocker all sit in this category, as does Microsoft's subscription-based Azure service.

    The hardware floor is higher for a signing service than for the token on your own deskTwo side-by-side panels comparing the minimum hardware certification the Code Signing Baseline Requirements set in two different clauses. The left panel, section 6.2.7.4.1, covers hardware the subscriber holds and requires a module certified as conforming to at least FIPS 140-2 Level 2 or Common Criteria EAL 4 plus. The right panel, highlighted in gold, covers section 6.2.7.3 for Signing Services including cloud code signing and requires at least FIPS 140-2 Level 3 or Common Criteria EAL 4 plus, one level higher. A note beneath states that a subscriber moving to a signing service is handing the key to hardware held to a stricter standard than the token they would have bought, which is the opposite of what most buyers assume.Two clauses, two floors — and the higher one is not yours6.2.7.4.1 — hardware you holdyour token, your HSM, your cloud HSMFIPS 140-2 Level 2 or CC EAL 4+you prove it, once per issuanceby one of the seven methods6.2.7.3 — a Signing ServiceCA cloud signing and equivalentsFIPS 140-2 Level 3 or CC EAL 4+the operator proves it, in an audityou sign an agreement insteadHanding the key to a signing service moves it to hardware held to a stricter standard,not a looser one. What you give up is custody, not certification level.
    This asymmetry surprises people who assume "my own hardware" is automatically the stronger posture. On paper the service's module is rated a level above the one you would have bought; the argument for keeping custody has to be made on control, not on the certification.

    The detail that rarely gets airtime is the level. Section 6.2.7.3 holds a Signing Service to at least FIPS 140-2 Level 3, a full level above the Level 2 floor that applies to hardware you keep yourself. Whatever else you give up by not holding the key, you are not stepping down in certification terms — the case for custody has to rest on control and jurisdiction, not on the strength of the box.

    What you trade is a service dependency and an authentication flow that has to fit your build process, which is the real decision rather than the compliance one. Our comparison of cloud code signing against a USB token walks through what each option does to an unattended build, and code signing in CI/CD pipelines covers the patterns teams use once the key lives somewhere they cannot touch.

    Do you attest again at renewal?

    At a full-term renewal, expect to. Section 4.2.1 permits reuse of a private key protection validation carried out no more than 13 months before the certificate is issued. Since March 1, 2026 a code signing certificate runs for at most 460 days, which is about two months longer than that window, so a certificate renewed when the old one expires sits just outside the shortcut and the verification is done again.

    The 13-month reuse window against a 460-day certificate termA horizontal timeline running from day zero, the day your key protection is verified, to day 460. A band covering the first 13 months, roughly 396 days, is marked as the period in which section 4.2.1 allows a certifying authority to reuse the earlier private key protection validation. The certificate term, capped at 460 days for certificates issued on or after 1 March 2026, extends about two months past the end of that band. A marker at roughly day 200 shows a second certificate bought mid-term falling inside the reuse window, and a marker at day 460 shows a renewal at expiry falling outside it, where the verification has to be done again.Why a renewal at expiry lands just outside the shortcut13 months — validation may be reused (4.2.1)460 days — maximum certificate term since 1 March 2026day 0~day 396day 460a second certificate mid-terminside the window — reuse allowedrenewal at expiryoutside it — verify again
    Two months is the whole story here. Had the Forum capped validity at 13 months rather than 460 days, every renewal would have inherited its predecessor's verification; as written, most do not.

    Where the clause earns its keep is mid-term. A second certificate for another product line, a reissue after a name change, or an early renewal at month ten all fall inside the 13 months, and the CA may lean on the verification it already has. Teams that batch their certificate purchases get more out of this than teams that order one at a time, which is a small argument for aligning renewal dates if you hold several.

    One wrinkle to raise with your CA rather than assume: the reuse sentence names methods 4, 5 and 7 of section 6.2.7.4.1, which is the key protection clause, while the verification methods themselves are numbered separately in 6.2.7.4.2. The cross-reference reads oddly against a clause whose current subscriber options are numbered 7 to 9, so ask how your CA applies it before planning a purchase around the shortcut. The renewal rhythm itself follows the 460-day validity cap, which is now the date most publishers diary.

    What to settle before you pay

    Four questions, asked in the CA's support queue, remove almost every way this goes wrong. Which verification methods do you support? Is my exact module and firmware on your accepted list? What attestation format do you read, and is there a sample? And if I have to go the auditor route, whose credentials do you accept? Getting those answers in writing costs an afternoon and saves the situation where a certificate is paid for and the key cannot be verified.

    Order matters too. Generate the key pair and produce the attestation before or during enrolment, never after — a key that already exists outside the module cannot be retrofitted into compliance, and a CA that has issued against the wrong evidence has a revocation problem rather than a support ticket. If the enrolment tooling is unfamiliar, the walkthroughs for what a CSR contains and for the documents a code signing order needs cover the rest of the paperwork that runs in parallel.

    And be honest with yourself about why you want custody. Keeping the key in hardware you control is the right answer when policy or jurisdiction demands it, and an expensive habit when it does not. The attestation machinery exists to make that choice possible, not to make it compulsory.

    Frequently Asked Questions

    Answers to common questions about certificates and our services.

    What is key attestation for a code signing certificate?

    Key attestation is a statement signed by your hardware, using a key the manufacturer put there at the factory, saying that the private key in your certificate request was generated inside that device and cannot be exported from it. The Code Signing Baseline Requirements describe it in section 6.2.7.4.2 as a certificate request the subscriber counter-signs, verifiable against a manufacturer's certificate, and the document itself adds the phrase "commonly known as key attestation". The CA checks that signature chain before it issues anything.

    Can I use a YubiKey for a code signing certificate?

    A FIPS model, yes, with several CAs. The YubiKey 5 FIPS Series holds a FIPS 140-3 validation at overall Level 2 with Physical Security at Level 3, which clears the FIPS 140-2 Level 2 floor the code signing rules set for subscriber hardware, and the PIV applet can produce an attestation for a key it generated. Sectigo documents the procedure for customer-owned YubiKeys directly. A non-FIPS YubiKey does not clear the floor, so check the exact model and firmware before ordering the certificate.

    Is a CSR enough on its own?

    No, and this is where most first attempts stall. A certificate signing request proves you hold the private key matching the public key inside it, which is a different claim from proving where that key lives. Any laptop can produce a valid CSR for a key sitting in a file. Since June 1, 2023 the CA must satisfy one of the methods in section 6.2.7.4.2 as well, so the attestation travels alongside the CSR rather than inside it.

    What if my HSM does not support attestation?

    Three of the other six methods are written for exactly that case. The CA may accept an internal or external IT audit confirming you only generate code signing key pairs in a suitable module, a report from a cloud key protection subscription, or a letter from an auditor the CA approves who watched the key generation ceremony. SSL.com publishes this last route as Bring Your Own Auditor and lists what the auditor must confirm, down to the key being marked non-extractable and sensitive under PKCS#11.

    Does the CA need to see the attestation again when I renew?

    Usually yes, at a full-term renewal. Section 4.2.1 lets a CA reuse a private key protection validation performed no more than 13 months before issuance. A code signing certificate issued on or after March 1, 2026 runs for at most 460 days, which is roughly two months longer than that window, so a certificate renewed at expiry sits outside it. A second certificate bought partway through the first one's life often falls inside it, and that is when the reuse clause saves you the paperwork.

    Does cloud code signing need attestation?

    Not from you. Method 7 of section 6.2.7.4.2 lets the subscriber provide an agreement that they use a Signing Service meeting section 6.2.7.3, and the evidence obligation moves to the service operator, who is audited against it. The bar there is higher than the one your own token has to clear: a Signing Service must protect subscriber keys in a module conforming to at least FIPS 140-2 Level 3, against Level 2 for hardware you hold yourself.

    Who chooses which verification method is used, me or the CA?

    The CA chooses which methods it supports, and you choose from what is left. Section 6.2.7.4.2 says one of the seven methods must be employed, without granting the subscriber a preference. In practice a CA that ships its own tokens may support only that route plus its cloud service, while a CA that sells to enterprises will document an attestation and an audit path. Ask before you pay, because the answer is not a setting you can change afterwards.

    Still Have Questions?

    Contact our support team with questions about certificates, installation, or technical issues.

    If the evidence trail is the part you want to avoid

    Most publishers who set out to use their own HSM discover the work is in the verification rather than the signing. The Certum-issued certificates we resell are delivered through cloud signing, where the key is generated in the CA's module and the evidence sits with them under section 6.2.7.3. See what cloud code signing certificates cost before you commission an auditor.

    Related reading