Extension Client Certificate APIs: Platform Keys, TLS Handshake, and Enrollment
How browser extension certificateProvider, platformKeys, and enterprise.platformKeys expose client certificates for TLS and managed-device attestation.
This page summarises Chrome extension API reference documentation for client certificate authentication in extensions: supplying certificates during TLS (certificateProvider), reading and signing with certs already on the device (platformKeys), and enterprise enrollment plus hardware attestation on managed ChromeOS (enterprise.platformKeys). The three APIs solve different problems; picking the wrong one is a common integration mistake.
certificateProvider: how an extension exposes client certificates during TLS
Section titled “certificateProvider: how an extension exposes client certificates during TLS”The certificateProvider API is for extensions that own client certificates and private keys (for example on a smart card or corporate backend) and must make them available to the browser during mutual TLS. Typical use on ChromeOS follows a fixed event-driven pattern.
Typical usage of this API to expose client certificates to ChromeOS follows these steps:
The Extension registers for the events onCertificatesUpdateRequested and onSignatureRequested. The Extension calls setCertificates() to provide the initial list of certificates after the initialization. The Extension monitors the changes in the list of available certificates and calls setCertificates() to notify the browser about every such change.
— Google Chrome, certificateProvider
During a handshake, the browser may fire onCertificatesUpdateRequested, asks for the current list via setCertificates (include certificatesRequestId when answering that event), filters certs against the server’s request, and shows a certificate selection dialog unless policy auto-selects a certificate (for example AutoSelectCertificateForUrls). If the user approves, onSignatureRequested delivers unhashed input, an algorithm, and the chosen certificate DER; the extension signs with the matching private key and returns the result through reportSignature. Signing may require building a DigestInfo prefix and PKCS#1 padding before signing, depending on the algorithm.
Each advertised certificate is described as ClientCertificateInfo: certificateChain must contain exactly one DER-encoded X.509 client certificate as the first element, plus supportedAlgorithms listing every algorithm the extension can use for that cert. Only RSA client certificates are supported today.
| Algorithm constant | Meaning |
|---|---|
RSASSA_PKCS1_v1_5_SHA256 … SHA512 |
PKCS#1 v1.5 with the named hash |
RSASSA_PSS_SHA256 … SHA512 |
PSS with MGF1 and salt sized to the hash |
RSASSA_PKCS1_v1_5_MD5_SHA1 |
Deprecated; Chrome stopped requesting it as of version 109 |
If the private key is unavailable, call reportSignature with error: 'GENERAL_ERROR' and no signature so the handshake aborts cleanly.
The MV2 namespace chrome.certificateProvider documents the same lifecycle; new work should target the browser.* reference.
platformKeys: how an extension uses certificates already in the OS store
Section titled “platformKeys: how an extension uses certificates already in the OS store”platformKeys is for extensions that should use platform certificate stores, not certs the extension generates externally. selectClientCertificates takes a ClientCertificateRequest (allowed CAs as DER distinguished names, preferred certificateTypes, etc.) and optional clientCerts to filter a supplied list instead of querying the OS.
If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform’s certificate stores that are available to this extensions. Entries that the extension doesn’t have permission for or which doesn’t match the request, are removed.
— Google Chrome, platformKeys
With interactive: true, the user picks certificates and thereby grants the extension access to those certs and keys; with interactive: false, only certificates already granted (automatically or manually) are returned.
After selection, getKeyPair or getKeyPairBySpki loads keys for use with platformKeys.subtleCrypto(), a SubtleCrypto implementation bound to those client certificates. For RSASSA-PKCS1-v1_5, the parameters object can set hash to "none" so sign applies PKCS#1 v1.5 padding without hashing—similar in spirit to certificateProvider’s unhashed input. Supported algorithms for getKeyPair are RSASSA-PKCS1-v1_5 and ECDSA; getKeyPairBySpki also supports ECDSA P-256.
For debugging TLS trust (not client auth), verifyServerCertificate checks a serverCertificateChain for a hostname and returns trusted plus optional debug_errors (documented as unstable and debug-only).
enterprise.platformKeys: enrollment, tokens, and Verified Access attestation
Section titled “enterprise.platformKeys: enrollment, tokens, and Verified Access attestation”enterprise.platformKeys targets managed ChromeOS scenarios: hardware-backed keys, certificate enrollment, and Verified Access remote attestation.
Tokens: user, system, and SubtleCrypto backends
Section titled “Tokens: user, system, and SubtleCrypto backends”getTokens() returns Token objects. Static ids are "user" (user-specific) and "system" (system-wide hardware token). Each token exposes:
subtleCrypto: hardware-backedSubtleCrypto; supports non-extractableRSASSA-PKCS1-v1_5(modulus up to 2048) and ECDSA P-256.softwareBackedSubtleCrypto(Chrome 97+): software-backed crypto with onlyRSASSA-PKCS1-v1_5up to 2048.
Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface.
— Google Chrome, enterprise.platformKeys
Each key can sign at most once unless the extension is allowlisted via the KeyPermissions policy, in which case signing can be unlimited.
Client certificate enrollment flow
Section titled “Client certificate enrollment flow”Enrollment typically uses the "user" token:
- Call
getTokens()and select the token withid == "user". generateKeyon the token’ssubtleCrypto, thenexportKey("spki", …)for the CSR public key.signthe certification request payload with the private key.- Send the CSR to your CA; on success,
importCertificate(tokenId, certificate)so the OS and browser can use the cert for authentication.
getCertificates(tokenId) lists DER client certs (useful for expiry checks). removeCertificate drops obsolete certs from the store.
challengeKey: device and user attestation (not everyday client TLS)
Section titled “challengeKey: device and user attestation (not everyday client TLS)”challengeKey (Chrome 110+) replaces deprecated challengeMachineKey and challengeUserKey. It responds to a challenge from the Verified Access Web API and is only useful on ChromeOS with that API.
A successful verification by the Verified Access Web API is a strong signal that the current device is a legitimate ChromeOS device, the current device is managed by the domain specified during verification, the current signed-in user is managed by the domain specified during verification, and the current device state complies with enterprise device policy.
— Google Chrome, enterprise.platformKeys
The call fails unless the device and user are managed and enterprise policy explicitly enables it for the caller. Optional registerKey can move the challenged enterprise key into a token so it can later be bound to a certificate like other signing keys.
Which API to use for mutual TLS and enterprise auth
Section titled “Which API to use for mutual TLS and enterprise auth”| Goal | API | Why |
|---|---|---|
| Certs and keys live in your extension or external service; browser only mediates TLS | certificateProvider |
Browser requests cert list and signatures via events |
| Certs already in the OS store; extension signs after user or policy grants access | platformKeys |
selectClientCertificates + token-bound subtleCrypto |
| Generate key in hardware token, enroll with a CA, attested ChromeOS devices | enterprise.platformKeys |
Token subtleCrypto, importCertificate, challengeKey |
certificateProvider is oriented to ChromeOS-style integration where the extension is the certificate authority from the browser’s perspective. platformKeys assumes existing platform trust material. enterprise.platformKeys adds policy-gated hardware keys and Verified Access—not a general replacement for platformKeys on unmanaged machines.
Common mistakes
Section titled “Common mistakes”- Double hashing:
onSignatureRequestedpasses data that is not hashed; applying an extra hash when the algorithm already implies one breaks the handshake. - Wrong
setCertificatesshape:certificateChainmust contain one cert; mismatchingsupportedAlgorithmswith what you can actually sign causes failed handshakes after user selection. - Mixing crypto worlds: Enterprise token keys cannot be used with
window.crypto.subtleor another token’ssubtleCrypto. - One-shot signing without KeyPermissions: Enterprise-generated keys sign once by default; repeated TLS without policy allowlisting fails after the first signature.
- Using
challengeKeyfor normal mTLS: Attestation APIs require managed devices and Verified Access; they do not replaceimportCertificatefor routine client authentication. - Ignoring non-interactive cert updates: Relying only on proactive
setCertificateswithoutonCertificatesUpdateRequestedleaves stale lists when the browser refreshes during TLS.
How to check this on your site
Section titled “How to check this on your site”- On a ChromeOS or managed test device, load an extension that implements the API you chose and confirm listeners are registered per the certificateProvider or platformKeys reference flow.
- Trigger a TLS connection that requests a client certificate and confirm whether the selection dialog appears (or policy auto-selection applies) as described in certificateProvider.
- For enrollment, after CSR and CA issuance, call
enterprise.platformKeys.getCertificatesand verify the new cert appears before testing authentication (enterprise.platformKeys). - If handshake signing fails, log
reportSignatureerrors and compare the requestedalgorithmenum with your implementation (certificateProvider). - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about so it can be corrected or explained.