-
-
Save dominicthomas/7107509 to your computer and use it in GitHub Desktop.
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 |
same
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=aman singh, OU=aaaa, O=aaaa, L=aaaa, ST=aaa, C=IN
[Storing my-upload-key.keystore]
keytool error: java.io.FileNotFoundException: my-upload-key.keystore (Access is denied)
java.io.FileNotFoundException: my-upload-key.keystore (Access is denied)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:123)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1375)
at java.base/sun.security.tools.keytool.Main.run(Main.java:423)
at java.base/sun.security.tools.keytool.Main.main(Main.java:416)
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=Dharam Das, OU=2, O=Star, L=Gorakhpur, ST=UP, C="+91"
[Storing my-upload-key.keystore]
keytool error: java.io.FileNotFoundException: my-upload-key.keystore (Access is denied)
java.io.FileNotFoundException: my-upload-key.keystore (Access is denied)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:123)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1375)
at java.base/sun.security.tools.keytool.Main.run(Main.java:423)
at java.base/sun.security.tools.keytool.Main.main(Main.java:416)
I found a solution for this. Open the terminal in the specified path, like:
C:\Program Files\Java\jdk-17\bin>
Save the keystore to a folder where you have full permissions, and run the following command:
powershell
& "C:\Program Files\Java\jdk-17\bin\keytool.exe" -genkeypair -v -storetype PKCS12 -keystore "C:\Users\Dharam\my-upload-key.keystore" -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
This worked successfully on my system.
Generating 2,048 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 10,000 days
for: CN=awwalasif, OU=awwalasif, O=awwalasif, L=noida, ST=UP, C=IN
[Storing my-upload-key.keystore]
keytool error: java.io.FileNotFoundException: my-upload-key.keystore (Access is denied)
java.io.FileNotFoundException: my-upload-key.keystore (Access is denied)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:289)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:230)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:118)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1372)
at java.base/sun.security.tools.keytool.Main.run(Main.java:419)
at java.base/sun.security.tools.keytool.Main.main(Main.java:412)