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:
- I have a public key for which I do not possess the corresponding private key.
- 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.
- 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.
- 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.