Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is Certificate Pinning?

Certificate pinning tells an app to accept only one specific certificate or public key for a server, so a valid-looking certificate from any other authority is rejected outright.

Illustration for the cybersecurity term Certificate Pinning
Home / Blog / Cybersecurity Terms / What Is Certificate Pinning?
17 November 2026

What Is Certificate Pinning?

What Is Certificate Pinning?

Certificate pinning narrows trust. Instead of accepting any certificate that chains to one of the hundred or so authorities in the device trust store, a pinned app accepts only the specific certificate, or the specific public key, that you told it to expect. Everything else fails the handshake, even if it is technically valid.

The reason is simple arithmetic. Standard TLS validation trusts every certificate authority in the store equally, so any one of them—compromised, coerced, or merely careless—can issue a certificate for your domain. DigiNotar proved the point in 2011, when fraudulent certificates for Google domains were used against Iranian users and the authority was removed from every major trust store within weeks.

What You Actually Pin

Three options exist, and the choice has real operational consequences.

On Android, the platform supports this declaratively through the network security configuration, with no custom trust manager to get wrong:

<domain-config>
  <domain includeSubdomains="true">api.example.co.uk</domain>
  <pin-set expiration="2027-06-30">
    <pin digest="SHA-256">primary-key-hash=</pin>
    <pin digest="SHA-256">backup-key-hash=</pin>
  </pin-set>
</domain-config>

OkHttp’s CertificatePinner offers the same thing in code. On iOS, App Transport Security handles ordinary validation, and pinning is added in a URLSession delegate or through a library such as TrustKit; since iOS 14 Apple also supports pinning declaratively in the app’s Info.plist.

The Rotation Problem

Pinning is the one security control that can take your service offline without any attacker involved. If the pinned key is replaced and users have not updated the app, every request fails, and the only fix is a release that must pass store review while customers are locked out. The discipline that prevents this is unglamorous: always ship at least one backup pin for a key you hold offline, set an expiry on the pin set so it degrades to normal validation instead of hard-failing, and keep the renewal in the same change calendar as your certificate expiry.

The web equivalent, HTTP Public Key Pinning, failed for exactly this reason. Sites locked themselves out, and Chrome removed support in version 72 in January 2019. Certificate Transparency monitoring replaced it: rather than refusing unexpected certificates, you detect them in public logs and act. Mobile apps kept pinning because they ship their own trust decisions and can be updated as a unit.

How Attackers Get Around It

Pinning defeats the casual interception path—a proxy with a user-installed root CA—and that alone is worth having, because Android has not trusted user-added certificates for app traffic by default since Android 7. On a rooted or jailbroken device, though, pinning is a speed bump. Frida and objection hook the validation routine at runtime; an APK can be repackaged with the pin set removed; on iOS, SSL Kill Switch patches the trust evaluation. Testers rely on exactly these techniques, which is why a pentest report that says “pinning bypassed” is a statement about the device, not a failure of the control.

Treat pinning as protection for ordinary users on ordinary devices, and layer it with root and jailbreak detection plus server-side attestation when the risk justifies it.

When It Is Expected in the UK

No UK regulation names pinning explicitly, but it turns up repeatedly in assessments of apps that handle money or health data. Open Banking implementations, PCI DSS scoped payment apps, and OWASP MASVS-NETWORK-2 all expect the app to constrain which certificates it will accept rather than relying on the device trust store. If your organisation runs its own inspection proxy, note the tension: pinning in a corporate app will break that inspection, so the exception has to be designed in rather than discovered.

Our Mobile Application Security Services verify pinning implementations end to end, including how your app behaves when a pin no longer matches.

FAQ – Frequently Asked Questions

Should Every Mobile App Use Certificate Pinning?

No. Pinning suits apps where interception has a direct financial or safety consequence—banking, payments, health, messaging. For a content app with no sensitive data, the operational risk of a locked-out user base outweighs the benefit. Decide from the data the app carries, and if you pin, commit to the rotation process rather than treating it as a one-off configuration change.

What Is the Difference Between Pinning a Certificate and Pinning a Public Key?

A certificate pin matches the whole certificate, so it breaks on every renewal, even a routine one. A public key pin matches a hash of the Subject Public Key Info, so a certificate reissued with the same key pair still validates. Public key pinning is the usual recommendation because it survives renewals while still restricting trust to keys you control.

Does Pinning Break Corporate TLS Inspection?

Yes, and deliberately so. An inspection proxy presents a certificate issued by the organisation’s own authority, which a pinned app will reject. Enterprises normally exclude pinned applications from inspection by domain, or ship an internally built variant with the inspection CA pinned alongside the production key. Plan this before deployment, not after the helpdesk tickets arrive.

How Do Testers Bypass Pinning?

On a rooted or jailbroken test device, they hook the validation code at runtime with Frida or objection, repackage the app with the pin set removed, or patch the platform trust evaluation. These require control of the device, which an attacker targeting a single ordinary user usually does not have. Pinning raises cost without being absolute.

Related Terms

You May Be Interested In These

What Is the Purdue Model?

Cybersecurity Terms

17 November 2026

What Is the Purdue Model?

Read More
What Are ASLR and DEP?

Cybersecurity Terms

17 November 2026

What Are ASLR and DEP?

Read More
What Is Network Access Control?

Cybersecurity Terms

17 November 2026

What Is Network Access Control?

Read More