I have recently started learning about PKI and have the following question/s.
As far as I know a signed certificate contains the domain name of the server that the certificate will be placed upon.
If I were to change the 'hosts' file of a PC and have, for example, www.youtube.com point to my own server, is it possible to 'take' Youtube's certificate and place it on that server, and have it appear as trusted?
I understand it would be pointless as an attack as you don't have the corresponding private key to decrypt the data, but to the end user, would the website appear as 'trusted' in their browser, as the domain is still correct?
The signature would also be valid I believe, as you haven't modified the certificate in anyway and therefore the hash would remain the same and the signature valid.
Would the above work? would the user send encrypted data to the fake 'www.youtube.com', but then nothing happen as the server hasn't got the key to decrypt it?
Any help clearing up the above questions would be greatly appreciated, Thanks.
Edit - I now know it will show as untrusted as a SSL/TLS session cannot be created, but as a follow up question -
On Chrome when I visit a HTTPS site, click the padlock, and then 'Connection'. There are 2 parts, identity and connection. I wonder if the top 'identity' part would show as green and trusted, but the bottom half would show as red because it can't establish a connection, for the reason mti2935 answered?