A TLS certificate is supposed to contain a copy of my public key, signed by a Certificate Authority.
But tutorials for creating a Certificate Signing Request show using a private key. Eg:
# generates a private key file
openssl genrsa -out domain.key 2048
# uses it to create a CSR
openssl req -key domain.key -new -out domain.csr
How can this work? I'm not giving my private key to the CA, right?
openssl req
derives the public key from the private one and uses that, but I'd like to confirm that guess. I know that deriving the private key from the public one is meant to be prohibitively expensive; maybe going the other direction is easy?