Keytool.exe

0 views
Skip to first unread message

Mica Withington

unread,
Jul 27, 2024, 7:03:03 PM7/27/24
to alvituwool

For various reasons, I want to make a batch script that can launch keytool.exe from either JRE or JDK. I thought this would be rather simple, but it has proven to be rather difficult. Here are some of the methods I have used, but none of which work:

keytool.exe


DOWNLOAD ✑ ✑ ✑ https://tiurll.com/2zSo88



There are several others I used, but to avoid clutter I did not list them. I'm pretty stumped on why this isn't working, I have made many many batch script launchers for a wide array of programs. Is this possible? Even creating a shortcut does nothing. I assumed the shortcut wouldn't work but thought it was worth a shot anyways.

In this article, you'll learn about how to code sign for Android (APK). You need to sign your app for Android if you selected Android as one of the platforms while creating and building your wrap project.

We'll use keytool.exe (available after installing Android Studio, from the folder location "Drive:\Program Files\Android\Android Studio\jre\bin\keytool.exe") to create a certificate to sign the application package. Keytool is used to manage a keystore (database) of cryptographic keys, X.509 certificate chains, and trusted certificates.

To sign the APK package, we'll use the apksigner tool. This tool allows you to sign APKs and ensure that the APK package signature are verified successfully on all Android platforms supported by the APKs.

You can host the package on a distribution service such as App Center. To distribute using Microsoft Intune, see Add an Android line-of-business app to Microsoft Intune. To learn about giving an app access to the Intune app protection service, see Give your app access to the Intune app protection service.

The following table contains possible examples of keytool.exe being misused. While keytool.exe is not inherently malicious, its legitimate functionality can be abused for malicious purposes.

Now I tried to do the same with Knime. I have installed the Java MySQL connector. However, I cannot figure out how to set up the SSL connection. Where can I add the certificate to connect to the database?

Somehow I assume that I'm looking atthe wrong place since sever google search has not helped me - and it usually does. Has someone either the answer or can lead me into the right direction on where to look for the answer?

Hello,

I just had a similar issue, and saw that none of these SSL user posts had been answered in the Knime Community. So here is what worked for me.

I figured out how to connect Knime to my SSL database (in this case, it was a Virtual Database called Denodo... but should be similar for other databases). You have to install the public key for your database directly into your Knime JRE environment using the Command Line / Terminal. Note that Knime comes with it's own JRE enviroment, so this isn't your local JRE. Here are the instructions:

------------
Open a command prompt (preferably as administrator)
cd to the jre\bin folder under knime install directory. The keytool.exe should be located here.

Run the following command where "cacerts location" is the path to the cacerts file under the Knime install directory

I have followed the instructions in the topic "Can't Download ESP8266 Board Package - Installation & Troubleshooting - Arduino Forum" but didn't work out. I have below Arduino uno ide:1.8.13.
Any one can help?
//Jo

I tinker with stuff during my free time at work and I'm DEEP behind a corporate firewall so I didn't have much hope since this is usually a deal breaker. But it used to work and our IT department doesn't care about Arduinos so it SHOULD work. I began having this same issue when I decided to try the new Seeeduino XIAO. I followed the steps to add this entry to my preferences.txt file:

I tried nearly everything. I even installed VSCode to see if it would work and (now this is odd) I got VSCode's equivalent of the same problem. Basically if you setup VSCode it should read alot of the configuration from the Arduino IDE and work just fine. Keywords here are "from the Arduino IDE". So VSCode relies on your Arduino IDE already working perfect. Mine was broke somewhere, or so I thought.

After extensive research I discovered this is a common output from Java. It happens when (in Java land) you don't have your certificates set up for your SSL. This error response is generated by Java because it is trying to validate your ability to reach out onto the internet and get stuff using a non-browser application. (I've seriously condensed what all really goes on.) But suffice to say, you can't get the files because you don't have the right certificate.

I and most likely you too have Java installed on my computer already. Well guess what. So does Arduino. You most likely have two versions of Java installed which is not supposed to happen but the Arduino IDE contains a full Java Runtime Environment too. To do this right you will need to do this twice if you have two installations of Java like me.

Open a command prompt and copy and paste these two long command lines:
when it asks for a password the standard password here is "changeit" so just enter that and it should work though you might could use anything, don't. This worked every time.

For this next command you will need to know where keytool.exe in your existing java installation. Mine was as shown below but hopefully if you're this deep you can at least understand where Im going here. You should use the keytool.exe that goes with the version of Java you're working with. There is a file in "...\lib\security" called "cacerts" that you are adding the new certificate to. And you should do it to both installations of Java. So now enter this if you are using Java 1.8.0_281 or change the line accordingly.

I had a bit of a problem recently where a password that I needed, that was quite important, wasn't recorded in a password safe. A year ago that wouldn't have been a problem, as I was typing this password a lot, but after a period of inactivity on that project I was stuck. Fortunately this wasn't a password I had set (it was set by a colleague), so it was less complicated than my normal style. I could also remember parts of the password with certainty, leaving me just some characters in the middle that I couldn't remember. I could also remember that some of the password rhymed.

I was convinced I was missing three lower case letters, with 17,576 potential combinations. Admittedly, the fact there was a rhyme in there would help reduce the number of combinations, but I'd still need to run through the combinations to be sure I'd found everything that could rhyme. I wasn't keen to run through 17,576 combinations manually, so decided on a script to automate the process.

Having recently been doing some research into "AI" [1] (large language models) to assist with programming, I was keen to see if I could use an "AI" to help solve this problem. I chose PowerShell as my scripting language, as I was on a Windows machine and PowerShell is my chosen language there, and Microsoft Co-pilot as my "AI" of choice - it's built in to my Windows 11 machine.

Disclaimer: this post is provided to show the journey I took and to provide a hopefully interesting insight into how a large language model can help with tasks such as retrieving your own password. You are not permitted to use this information to gain access to a system you are not authorised to access (which may be illegal in your area).

I had a Java keystore file that contained a private key used to cryptographically sign a file. Don't worry too much about what that means, but the important thing is that the keystore was protected with a password. I don't use Java's keytool.exe very often, so I asked Co-pilot for advice on how to pass the password to it:

What I've learned from my research to date is that a lot of hosted large language models (LLM) will outright refuse to write malware or hacking tools. From an ethical standpoint that's probably a good thing. You could possibly host the model yourself to bypass the restriction, but I didn't expect Co-pilot to be any different. Once I'd solved my problem I tried the direct route, which confirmed my suspicions:

Having mentally ruled out the direct route I looked to break my problem down into chunks, and then identify what I wanted Co-pilot to help with. To be clear, I could have done this myself, without Co-pilot, but I wanted the opportunity to play with the LLM, and wanted the starter help it gave to (hopefully) save time. Given I was confident I only needed three characters in the middle of the password, I broke up the work as follows:

I really like how Co-pilot lists its sources, as that helps you learn and also allows you to check if the output has any licences or restrictions. Unfortunately it wasn't clear which referenced article related to that answer, but I'm assuming that code sample was derived from "function - Get all combinations of an array - Stack Overflow" despite not finding the code there, and it being in a different language.

Generating all of the combinations using the fixed script (the second one) took about 20 seconds on my laptop. I could store each one, then go over the list trying the password but that seemed excessive. Possibly it would have been quicker, but it was not necessary. I took the script and modified it to perform the next steps.

I should probably explain what these are. When programs finish (or stop running) they provide an exit code that gives the operating system information on whether or not the operation succeeded. Generally, a value of zero (0) means everything succeeded, and a non-zero value means there was a problem.

I'd already tested with keytool.exe by creating a key store with a known password. By providing the correct password I confirmed I got a zero exit code. Providing the wrong password gave me an exit code of one.

I started off with a keystore for which I knew the password followed the pattern I described above, making sure the combination was early on in the sequence. This was so that I could test the script would work correctly. I set the password to THE-BIT-I-KNOWabs873 after generating the keystore following advice from Co-pilot:

64591212e2
Reply all
Reply to author
Forward
0 new messages