A public-private key pair is two mathematically related asymmetric cryptographic keys. The public key can be shared; the private key must remain secret. The pair supports encryption and digital signatures without distributing one shared secret to every service. section 6.2 section 6.3.3
Use each half for its intended operation:
- Encrypt with the public key and decrypt with the matching private key; only the private-key holder can recover the plaintext. section 6.2
- Sign with the private key and verify with the matching public key; verification establishes integrity and authenticates the signer. section 6.3.3
- Give each service its own pair, store private keys securely, and share public keys through a mechanism that prevents tampering or impersonation. section 6.2 section 6.6
- Replace the entire pair after private-key compromise; sharing only a public key does not compromise the system's secrecy. section 6.2
Warehouse and payment services
A warehouse service encrypts refund data with the payment service's public key. The payment service decrypts it with its matching private key. For authentication instead, the warehouse signs request data with its private key, and the payment service verifies the signature with the warehouse's public key. section 6.4 section 16.2.3
Figure 6.3 A key pair, consisting of a private and a public key. The keys are numbers that are related by means of a mathematical equation. The private key works only with the public key in the same key pair, and the public key works only with the private key from the same key pair. The private key must be kept secret, but the public key can be shared with anyone, including friends, enemies, and hackers. Security in a public key cryptosystem depends on keeping private keys private.
Use the key-pair diagram to compare the shared public key, protected private key, mathematical relationship, and resulting trust boundary. section 6.2





