amazon-kmskey-pair

Is KMS data key pairs secure?


So, I'm building an application for MTLS authentication and generate X509 certificates using AWS ACM PCA and bundle them together with a private key in PKCS#12 format.

At the moment I generate key pairs programatically in Java which are never stored.

But since I'm not a security expert I thought maybe it's better to use AWS KMS for creating key pairs.

So, it seem like what I need is a CMK which can generate data key pairs which are stored in KMS. If they're stored in KMS and I can fetch the private key at any time, how is that more secure than not storing it at all?

Or is the purpose of KMS only to store keys securely?


Solution

  • If you have a use for the encrypted private key that kms.generateDataKeyPair will provide, then it would be of use. It would also be a nice way to ensure that your keys are being generated securely (secure randomness, etc).

    It’s important to note, KMS will not store the generated key pair. The idea is that you would store the plaintext public key, and the encrypted private key, and call kms.decrypt to turn the encrypted private key into plaintext whenever you need it.