Skip to content

Instantly share code, notes, and snippets.

@sharepointoscar
Last active July 25, 2018 14:12
Show Gist options
  • Save sharepointoscar/fabcc4ff554ecc63235873e6f3428a62 to your computer and use it in GitHub Desktop.
Save sharepointoscar/fabcc4ff554ecc63235873e6f3428a62 to your computer and use it in GitHub Desktop.
#Generate pem file from key
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
# this generates an ssh keypair
ssh-keygen -C "mykeypairname" -f id_rsa -P ""
# Create Root Certificate
openssl genrsa -out CPManageRootCA.key 2048
openssl req -x509 -new -nodes -key CPManageRootCA.key -sha256 -days 1024 -out CPManageRootCA.pem
# Generate client key & certificate signing request
openssl genrsa -out CPManageClient1.key 2048
openssl req -new -key CPManageClient1.key -out CPManageClient1.csr
# Generate client certificate based on our own CA certificate
openssl x509 -req -in CPManageClient1.csr -CA CPManageRootCA.pem -CAkey CPManageRootCA.key -CAcreateserial -out CPManageclient1.crt -days 1024 -sha256
# Also generate client certificate in pfx format
openssl pkcs12 -inkey CPManageRootCA.key -in CPManageRootCA.pem -export -out cpmanage_client_oscar.pfx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment