Step 1: Create CSR request openssl req -x509 -newkey rsa:2048 -keyout test1-key.pem -out test1-cert.pem pass phrase: test1 Step 2: Remove passphrase openssl rsa -in test1-key.pem -out test1-key.pem Step 3: Get Public Key openssl rsa -in test1-key.pem -pubout > test1-pubkey.pem