2

Perhaps the answer is no, and perhaps this is a dumb question. However I am trying to understand the underlying principles better.

My understanding of certificate signing process.

  1. I generate a key pair.
  2. I create a CSR. [CSR is essentially the public key + DN information signed using the corresponding private key to prove ownership of the private key.]
  3. I provide the CSR to a CA.
  4. CA verifies my ownership of DN and the private key.
  5. CA signs the public key, DN and validity using its private key, hashes this signature and appends to create a certificate.

Scenario:

  1. I have a public key for which I do not possess the corresponding private key.
  2. Can I create a CSR without the private key?
  3. Can I create a certificate for this CSR if I am the CA and I ignore to validate the private key ownership?
  4. Can the above be trivially demonstrated using openssl commands which are available or does it need tweaks and custom tools?
0

3 Answers 3

2

Your understanding of certificate signing process

Yup, I think you generally have this right. One minor quibble is that it's not necessarily the DN that's being verified; nowadays the important information is usually carried in the SubjectAlternativeName field(s). Often a CA will only require the CSR to contain a public key and signature, and any other metadata in the CSR is ignored and taken instead from your account info.

Also, to elaborate on your 2., the CSR format is specified in RFC 2989 and does indeed include a mandatory signature field. Any CA worth their salt should validate an incoming CSR by checking that the signature validates under the public key contained in the CSR and reject the CSR if it does not.

 4.2 CertificationRequest

   A certification request shall have ASN.1 type CertificationRequest:

   CertificationRequest ::= SEQUENCE {
        certificationRequestInfo CertificationRequestInfo,
        signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
        signature          BIT STRING
   }

Scenario:

  1. I have a public key for which I do not possess the corresponding private key.
  1. Can I create a CSR without the private key?

Technically yes, you can throw any random bits into the signature field and have a syntactically-valid CSR, but anyone trying to process the CSR should reject it because it has a broken signature.

  1. Can I create a certificate for this CSR if I am the CA and I ignore to validate the private key ownership?

If you're the CA you can do whatever you like. You don't even need a CSR; if you have access to the CA private key then you can create certificates containing data you want by producing the X.509 ToBeSigned (TBS) structure in a hex editor, signing it, and stuffing the TBS structure and signature bytes into the right place in an X.509 object.

  1. Can the above be trivially demonstrated using openssl commands which are available or does it need tweaks and custom tools?

This I would need to go away and play with, which I don't have time for right now. The core question is whether openssl has a setting to disable CSR Proof-of-Possession (PoP) checks when issuing a cert from a CSR. If yes, then it'll happily sign any broken CSR you give it.

1
0

Can I create a CSR without the private key?

you can create, but not sign. CSR is a signed content and public key embedded in CSR is used to validate signature on CSR. If you don't possess the corresponding private key, you cannot craft signature verifieable with public key in CSR.

Can I create a certificate for this CSR if I am the CA and I ignore to validate the private key ownership?

technically, yes. You can do whatever you want. But other CAs won't. So it makes zero sense in general.

0

The certificate is like a LOCK. Your private key is the key to the lock.

It is true that the CA does not require you to send the private key over (that's a bit of a security risk, if you think about Man in the middle...).

But the Cert that is generated is meaningless - since only your private key can unlock that Cert.

So - you getting that cert is not going to support any use case - encryption or signing. That generated Cert is a LOCK that cannot never be unlocked...and will eventually be discarded (not supported by anyone). You could say - well, I am the CA - I support it by importing that into my trusted vault..

That's still not going to work, if you do not have the private key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.