Self Signed CA:
CLIENT_ID="<Client-Product>" e.g. CLIENT_ID="ClientID"
CLIENT_SERIAL="<Client-Release-Number>" e.g. CLIENT_SERIAL="6889"
SERVER_ID="<Server-Product>" e.g. SERVER_ID="ServerID"
SERVER_SERIAL="<SERVER-Release-Number>" e.g. SERVER_SERIAL="1081"
openssl pkcs12 -export -out certificate.pfx -inkey ${CLIENT_ID}_${CLIENT_SERIAL}.key -in ${CLIENT_ID}_${CLIENT_SERIAL}.pem
Command to convert .pem file to .crt file:
openssl x509 -in tnic_client_9000.pem -out tnic_client_9000.crt
- Create Private Key for Self Signed CA
openssl ecparam -genkey -name secp256r1 | openssl ec -out ca.key - Create CA Certificate for Self Signed CA
openssl req -new -x509 -days 36500 -key ca.key -out ca.pem -subj "/C=IN/ST=Karnataka/L=Bengaluru/O=company name/OU=Prod Operations Department/CN=prodops.domain.com - Verify the content of CA certificate
openssl x509 -in ca.pem -noout -text
CLIENT_ID="<Client-Product>" e.g. CLIENT_ID="ClientID"
CLIENT_SERIAL="<Client-Release-Number>" e.g. CLIENT_SERIAL="6889"
- Create Private Key for Client
openssl ecparam -genkey -name secp256r1 | openssl ec -out ${CLIENT_ID}_${CLIENT_SERIAL}.key - Generate the Certificate Signing Request CSR
openssl req -new -key ${CLIENT_ID}_${CLIENT_SERIAL}.key -out ${CLIENT_ID}_${CLIENT_SERIAL}.csr -subj "/C=IN/ST=Karnataka/L=Bengaluru/O=Company name/OU=Prod Operations Department/CN=client.domain.com" - Create Client Certificate Signed(Done by Self Signed CA)
openssl x509 -req -days 36500 -in ${CLIENT_ID}_${CLIENT_SERIAL}.csr -CA ca.pem -CAkey ca.key -set_serial ${CLIENT_SERIAL} -out ${CLIENT_ID}_${CLIENT_SERIAL}.pem - Verify the content of Client Certificate
openssl x509 -in ${CLIENT_ID}_${CLIENT_SERIAL}.pem -noout -text
SERVER_ID="<Server-Product>" e.g. SERVER_ID="ServerID"
SERVER_SERIAL="<SERVER-Release-Number>" e.g. SERVER_SERIAL="1081"
- Server Private Key Generation openssl ecparam -genkey -name secp256r1 | openssl ec -out ${SERVER_ID}_${SERVER_SERIAL}.key
- Server CSR Generation
openssl req -new -sha256 -key ${SERVER_ID}_${SERVER_SERIAL}.key -subj "/C=IN/ST=Karnataka/L=Bengaluru/O=Company name/OU=Prod Operations Department/CN=server.domain.com" -out ${SERVER_ID}_${SERVER_SERIAL}.csr - Create Server Certificate Signed (Done by Self signed CA)
openssl x509 -req -in ${SERVER_ID}_${SERVER_SERIAL}.csr -CA ca.pem -CAkey ca.key -set_serial ${SERVER_SERIAL} -out ${SERVER_ID}_${SERVER_SERIAL}.pem -days 36500 -sha256 - Verify the content of Server Certificate
openssl x509 -in ${SERVER_ID}_${SERVER_SERIAL}.pem -noout -text
openssl pkcs12 -export -out certificate.pfx -inkey ${CLIENT_ID}_${CLIENT_SERIAL}.key -in ${CLIENT_ID}_${CLIENT_SERIAL}.pem
Command to convert .pem file to .crt file:
openssl x509 -in tnic_client_9000.pem -out tnic_client_9000.crt
Comments
Post a Comment