Skip to content

Instantly share code, notes, and snippets.

@jaykhimani
Created January 23, 2024 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaykhimani/160c153de488e7ea77c7c8f72102948b to your computer and use it in GitHub Desktop.
Save jaykhimani/160c153de488e7ea77c7c8f72102948b to your computer and use it in GitHub Desktop.
Handy command related to certificates and keystores
  • Create a local certificate authority
    keytool -genkeypair -v \
      -alias localca \
      -keystore identity.jks \
      -keyalg RSA \
      -keysize 4096 \
      -storepass changeme \
      -keypass changeme \
      -validity 3650 \
      -dname "CN=localCA,OU=RootCA,OU=Services,O=MyOrg,C=NL" \
      -ext BasicConstraints:critical=ca:true \
      -ext KeyUsage:critical=digitalSignature,keyCertSign,crlSign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment