A public-private key pair contains two mathematically related cryptographic keys. Keep the private key for signing JWTs; distribute the public key for validating their signatures. section 8.2 section 8.7
This arrangement lets an API verify tokens without receiving the signing secret. Generate the pair before using an asymmetric algorithm such as PS256, and validate the token’s claims while constraining the permitted algorithm. section 8.2 section 8.7
Generate an RSA pair for JWTs
OpenSSL can create a 3072-bit RSA pair with `openssl genpkey -algorithm RSA -out private_key.pem -outpubkey public_key.pem -pkeyopt rsa_keygen_bits:3072`. Load `private_key.pem` for signing with PyJWT and PS256; use the corresponding public key to verify signatures. section 8.2





