Skip to content

Instantly share code, notes, and snippets.

@usmansaleem
Created December 24, 2019 02:00
Show Gist options
  • Save usmansaleem/cf2ba3a7dba9bdda1343c328710370ee to your computer and use it in GitHub Desktop.
Save usmansaleem/cf2ba3a7dba9bdda1343c328710370ee to your computer and use it in GitHub Desktop.
Self Signed PFX key store using keytool
keytool -genkeypair -keystore rpc_keystore.pfx -storetype PKCS12 -storepass changeit -alias testrpcserver -keyalg RSA -keysize 2048 -validity 109500 -dname "CN=localhost, OU=PegaSys, O=ConsenSys, L=Brisbane, ST=QLD, C=AU" -ext san=dns:localhost,ip:127.0.0.1
@usmansaleem
Copy link
Author

Using OpenSSL to export PKCS12 to cert and private key:

openssl pkcs12 -in path.pfx -out newfile.crt.pem -clcerts -nokeys
openssl pkcs12 -in path.pfx -out newfile.key.pem -nocerts -nodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment