Skip to content

Instantly share code, notes, and snippets.

@Zellius
Created May 5, 2021 18:50
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 Zellius/a8f993cf8805170cd11aaf8ee9aa3d30 to your computer and use it in GitHub Desktop.
Save Zellius/a8f993cf8805170cd11aaf8ee9aa3d30 to your computer and use it in GitHub Desktop.
Import a single keystore key to another one
# Generate a new keystore
keytool -genkey -alias alias_name -keystore new_keystore.jks
keytool -delete -alias alias_name -keystore new_keystore.jks
# Import 'alias_to_import' from 'old_keystore.jks' to the 'new_keystore.jks' as 'new_alies'
keytool -importkeystore -srckeystore old_keystore.jks -destkeystore new_keystore.jks -srcstoretype jks -deststoretype jks -srcalias alias_to_import -destalias new_alies
# You can compare certificates SHA fingerprint
keytool -list -v -keystore new_keystore.jks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment