Environment Preparation:

1. Install the JRE

2. Find the JRE installation directory

Set temporary environment variables

set PATH=%PATH%;" C: \ Program Files \ Java \ JDK - 16.0.1 \ bin"Copy the code

Generating a Signing Certificate

Command:

keytool -genkey -alias yourname -keyalg RSA -keysize 2048 -validity 36500 -keystore test.keystore
Copy the code

Yourname: Your own name

Test. keystore: the directory for generating the keystore file

Check the certificate

Command:

keytool -list -v -keystore test.keystore
Copy the code

Test. keystore is the directory where the file resides

Convert the keystore file to JKS or PEM format

The. Keystore file is transferred to the. JSK file

Principle:.keystore –>.p12. p12 –>.jsk

.keystore – >. P12 command:

Keytool -importkeystore -srckeystore [absolute path]. Keystore -srcstoretype JKS -deststoretype PKCS12 -destkeystore [absolute path].p12Copy the code

.p12 – >. JSK command:

Keytool -v -importkeystore -srckeystore [absolute path]. P12 -srcstoreType PKCS12 -destkeystore [absolute path]. JKS -deststoreType JKSCopy the code

JSK file to.pem file

keytool -export -rfc -keystore fishjump.jks -alias fishjump -file fishjump.pem
Copy the code

Fishjump is the password library alias for the signature file