Generate Server Cerfificate signed by Certificate Authority 

#!/bin/bash
echo -n "enter servername:"
read SERVERNAME

# Create _2048bit_rsa_key_ for server
openssl genrsa -out ${SERVERNAME}.key 2048

# Generate a certificate signing request based on an existing certificate
openssl req -new -key ${SERVERNAME}.key -out ${SERVERNAME}.csr

# Sign csr with the CA private key using CSR you just made
openssl x509 -req -days 1825 -in ${SERVERNAME}.csr -CA cacert.pem -CAkey \
cakey.pem -CAcreateserial -out ${SERVERNAME}.crt

# Convert to PEM
openssl x509 -in ${SERVERNAME}.crt -out ${SERVERNAME}.pem -outform PEM

# Verify certificate
openssl x509 -in ${SERVERNAME}.crt -text -noout


[ add comment ] ( 2 views )   |  [ 0 trackbacks ]   |  permalink

<Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>