I need to use a signature for a JWT that needs to be created or verified on 12 different servers running in a load balanced environment. They all already have the same RSA Key Pair stored in the Windows Certificate Store used for serving the application over HTTPS.
This question has already been essentially asked here: Is D parameter of the RSA strong enough to be used as secret for HMAC calculation? but the focus there is on strength and/or purpose of encryption.
Initially I intended to sign the JWT using RS256, and I wrote the code and all was well....until I checked the output. Obviously (after the fact) the signature is rather long...2048 bits rather than 256. The total size of the JWT without the signature is probably only 2000 bits give or take, so it is basically doubling the size of the final token. The token will be used on multiple requests to downstream services, some of them with very small message bodies, so I am little reluctant to do this.
I have looked at various solutions DPAPI, .Net Protection and manually maintaining a secret encrypted with the public key. I need the solution to work in .Net and in .Net Core. All of them present issues around creating and managing the keys across multiple environments which are totally taken care of by the existing setup if I just use the D value as the secret. So...
Why should I NOT use the D value as my HMAC secret?