How does Certificate and Key Management protect cryptographic keys used in secure enterprise integrations?
Answer
Basics: A digital certificate binds a public key to an identity; the matching private key proves you own it. Integrations use them to sign tokens, prove identity to another server, or verify that a payload came from a trusted party. Salesforce provides one place to create, import and rotate them.
How it works:
- Setup > Certificate and Key Management > create a Self-Signed Certificate (choose key size, commonly 2048) or a CA-Signed Certificate (generate a CSR, send to the CA, upload the signed result).
- Or import a JKS keystore that already holds a key pair.
- Reference the certificate by its unique name: in a Connected App for JWT bearer flow, in SAML/SSO settings for signing assertions, in a Named Credential/External Credential for client certificate (mutual TLS) authentication, or in Apex via
Crypto.signWithCertificateandHttpRequest.setClientCertificateName. - Download only the public certificate to share with partners.
Advanced / deep dive: The same Setup area also holds Shield Platform Encryption key management (tenant secrets, bring-your-own-key, cache-only keys), which is a different key class from integration certificates. For inbound mutual authentication, certificates are uploaded as trusted CA/client certificates and must be enabled for the org (some capabilities need Salesforce Support to enable; verify). Self-signed certificates suit internal JWT flows; production partners usually require CA-signed certificates. Plan rotation: certificates expire, and an expired certificate breaks SSO or JWT logins instantly. Sandboxes inherit certificate metadata on refresh but keys differ per org, so do not assume parity.
Code / config example:
// Sign a JWT-style payload with a Salesforce-held private key (key never leaves the platform)
EncodingUtil.base64Encode(Blob.valueOf());
EncodingUtil.base64Encode(Blob.valueOf());
header + + payload;
Crypto.signWithCertificate(, Blob.valueOf(unsigned), );
unsigned + + EncodingUtil.base64Encode(sig);