Client certificates vs API keys for healthcare integrations
- DICOM DIMSE runs over raw TCP, not HTTP, so there is no header field for API keys or bearer tokens.
- X.509 client certificates prove possession of a private key that never leaves the device, unlike shared-secret API keys.
- Mutual TLS authentication happens at the transport layer, rejecting invalid clients before application code parses any data.
- Client certificates carry fixed validity windows and require PKI lifecycle steps such as CSR generation and revocation.
- Hospital security teams accept client certificates and mTLS as the standard approach for medical device connectivity.
When web developers build APIs, bearer tokens and API keys are the default choice. You generate a random secret string, put it into an HTTP Authorization header, and verify it on the server.
When those same developers start integrating medical devices, CT scanners, or hospital gateways, they find that standard DICOM modalities do not accept API keys. Instead, these systems demand X.509 client certificates and mutual TLS (mTLS).
This requirement is not stubbornness from hospital IT teams. It comes from the fundamental differences between how web apps authenticate and how medical hardware protects patient data on the wire.
Why do medical devices reject API keys?
Standard DICOM networking (DIMSE) operates over a raw TCP stream, not HTTP. The DICOM Upper Layer protocol opens a connection on port 104 or secure port 2762. It negotiates an association using Application Entity (AE) titles and binary PDUs. There is no HTTP header field where an API key or bearer token can fit.
Even when medical devices adopt modern web protocols like DICOMweb, security standards in healthcare treat API keys as shared secrets that carry high operational risk. An API key is a bearer token under RFC 6749. Anyone who intercepts the key string can present it to your API and impersonate the sender.
In a hospital, imaging devices often sit in shared exam rooms. Modality consoles run embedded operating systems like Windows IoT or Linux. If you configure a plain API key on an imaging console, hospital staff or contractors can view that secret on screen. Once copied, an attacker can replay that token from anywhere on the internet.
X.509 certificates change the security model completely:
- Proof of possession: During a TLS handshake (RFC 8446), the client proves it holds the private key matching its certificate. It proves this by cryptographically signing handshake data.
- The secret never moves: The private key never leaves the device’s storage. It is never transmitted across the network, never logged by intermediate proxies, and cannot be captured in transit.
- No replay attacks: An eavesdropper who captures the public certificate cannot impersonate the device. Without the private key, the cryptographic signature fails every time.
Where does authentication happen in the network stack?
The layer where authentication occurs defines how much exposure your cloud infrastructure has to untrusted traffic.
flowchart TD
subgraph API Key Pattern
A1[TCP Handshake] --> B1[Server TLS Handshake]
B1 --> C1[HTTP Request Parsing]
C1 --> D1[Application Auth Middleware: Check API Key]
end
subgraph Client Certificate Pattern
A2[TCP Handshake] --> B2[Mutual TLS Handshake: Verify Client Cert]
B2 --> C2[DICOM / HTTP Ingest Stream]
end
With API keys, authentication happens at the application layer. Your cloud receiver must complete the TCP connection and finish the server TLS handshake. Next, it must parse incoming HTTP headers and verify the token against your auth store. If an unauthorized client floods your server with requests, your application layer spends memory and CPU cycles inspecting each payload.
With client certificates, authentication happens at the transport layer (RFC 9325). The TLS handshake fails immediately if the client does not present a valid certificate. The connection terminates before your application code parses a single frame of DICOM data or HTTP body bytes. This protects your edge against unauthorized data injection and denial-of-service attempts.
Comparing client certificates and API keys
Both credentials identify a remote sender, but their operational traits differ sharply:
| Operational Feature | API Keys / Bearer Tokens | X.509 Client Certificates |
|---|---|---|
| Underlying Standard | RFC 6749 / RFC 7519 | RFC 5280 / RFC 8446 |
| Protocol Support | HTTP/HTTPS only | Raw TCP (DIMSE port 2762), HTTPS (DICOMweb) |
| Network Layer | Layer 7 (Application) | Layer 4 / 6 (Transport / TLS) |
| Credential Type | Shared secret (transmitted on wire) | Asymmetric key pair (private key stays local) |
| Compromise Impact | Full replay ability from any network | Certificate alone is useless without private key |
| Revocation Method | Centralized flag update | CRL, OCSP, or gateway-level cert unlinking |
| Expiration Handling | Custom application logic | Hard cryptographic expiry enforced by TLS |
The operational cost: Managing certificate lifecycles
If client certificates offer superior security, why doesn’t every web API use them? The tradeoff is lifecycle management.
API keys are cheap to create and easy to distribute. A developer copies a 32-byte string from a dashboard, pastes it into a config file or .env, and tests the connection with curl.
Certificates require public key infrastructure (PKI):
- Key generation: You must generate a private key and a Certificate Signing Request (CSR) on or for the device. Common choices include 2048-bit RSA or 256-bit ECDSA.
- Distribution: You must install the certificate bundle and private key into the modality’s credential store. On older scanners, this requires an on-site service engineer entering an administrative service mode.
- Expiration and renewal: Every X.509 certificate carries a validity window with explicit start and end dates (RFC 5280). When a certificate expires, the TLS handshake halts immediately. If a modality scanner cannot finish its TLS handshake at 2:00 AM because an annual certificate expired, imaging stops moving.
- Revocation: If a laptop running a mobile gateway is decommissioned, you must revoke its identity immediately. You do this by removing its certificate from your gateway allowlist or publishing updated revocation lists.
Rotating certificates on physical scanners can be disruptive. For this reason, engineering teams often pair long-lived modality certificates (such as 1 to 2 years) with instant revocation controls on their cloud ingestion gateway.
Bridging devices to modern cloud pipelines
If your cloud ingestion pipeline requires medical modalities to push data directly to you, choose client certificates and mTLS. Hospital security teams understand and approve this architecture because it complies with DICOM Part 15 (PS3.15) secure transport profiles.
You can learn more about how mTLS secures DICOM in our guide on mutual TLS for DICOM connections. To see the operational differences between public endpoints and private network tunnels, read site-to-site VPN vs internet-facing endpoints for DICOM. For step-by-step guidance on provisioning connection details and sharing credentials with clinical engineering, see connecting a DICOM sender.
If you build an internal webhook receiver for downstream data processing, you can still use internal API keys between your gateway and internal microservices. But for the initial edge connection coming out of the hospital, client certificates are the standard for healthcare connectivity.
Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →