I am writing a provider for an API where I came across the following situation: One of my resources is a certificate. When I create a certificate I specify an ID (a string), the public key and the private key of the certificate. So when I want to create this certificate through my provider I get to specify the ID, the public key, and the private key of the certificate. So far, so good.
When I started implementing the read-part of the resource I realised that I am unable to read the private key back. I can only read the ID and the public key.
How do I handle this in my provider? I feel like this is a problem because I can’t verify that the state in the physical resource is the same as the Terraform state. I.e. the Terraform state will have three properties (id, public key, private key) but when I read the remote state I would only get two properties (id, public key).
I suppose someone has come across this situation before, how should I handle this?