Certificates, TLS, etc.
- Private Key
- Should never ever leave machine on which it was generated
- No transmitting private key in any form
- Certificate
- Issued by (CA)
- Issued for (Subject)
- Subject Public Key
Signature == Encrypted Subject Public Key
Subject Public Key * CA Private Key => Encrypted Subject Public Key
- CA
- For a given Subject
- Creates Signature (
Subject Public Key * CA Private Key => Encrypted Subject Public Key
) - Client can decrypt Signature using CA Public Key
- If
Decrypted Subject Public Key == Subject Public Key
it means that Subject is legit
- Intermediate CA
- Leak of Root CA Private Key would be disastrous
- That’s why instead of calling Root CA, we call some “subclass” of CA called Intermediate CA
- CSR
- Subject Public Key
- Send Subject CSR to CA
- CA generates Certificate based on CSR
- Root CA
- Signature of Root CA is Self-Signed
Issued by == Root CA == Issued for
- Formats
- PEM Format
- It’s base64 encoded certificate details
- You may save it as
.crt
file to make it recognizable by software
- PKCS#12 Format
- Contains both
- Private Key
- Certificate
- Private Key secured by password
- Contains both
- PEM Format
- Extensions
.crt
- Makes it easy for software to recognize this is certificate
- E.g. PEM Format file
.key
- Usually used to mark this is PEM Format Private Key
.p12
- Used for PKCS#12 Format