Local Certificate Authority for Self Sign Certificate
Published: August 12, 2018
Tags:
Here we will be creating local certificate authority.
- Create keys for CA
- Add the cert to trusted keychain.
- Now Certificates signed with CA’s key will work without issues.
- Create new certs
- Sign the certs using our created CA
Used commands :
To create the root ca key: openssl genrsa -out rootCA.key 2048
- To create password protected key:
openssl genrsa -des3 -out rootCA.key 2048
- To create password protected key:
Self sign the certificate:
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
Add that cert to macos keychain to trust it.
Create certificates that trust are signed by this CA.
- Create private key:
openssl genrsa -out device.key 2048
- Create CSR :
openssl req -new -key device.key -out device.csr
- Sign the key and get certificate:
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 365 -sha256
- Now use the private key and newly created certicate where you have trusted the base(ca) certificate and all will work fine.
- Create private key:
It will help me to improve/learn.