Questions tagged [keytool]

Key and Certificate Management Tool: manages a keystore (database) of cryptographic keys, X.509 certificate chains, and trusted certificates.

Keytool is a key and certificate management utility. It allows users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and authentication services, using digital signatures. It also allows users to cache the public keys (in the form of certificates) of their communicating peers.

1325 questions
32
votes
1 answer

Warning: use -cacerts option to access cacerts keystore

I am adding a cert to the Java keystore and I get the following warning. The command is successful. keytool -import -trustcacerts -keystore /usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts -storepass changeit -noprompt -alias my_root_ca.pem…
Vijay Kumar
  • 2,439
  • 2
  • 32
  • 51
32
votes
6 answers

Generating hash key for app using facebook sdk

I am using facebook sdk for login into my application. The application runs fine on HTC devices. The application also works fine on Samsung devices if there is no facebook app pre installed. But if there is already facebook app on mobile and then…
abhishek
  • 1,434
  • 7
  • 39
  • 71
32
votes
2 answers

Node child_process.spawn multiple commands

I wan to automate the creation and extracting of keystore. The problem I'm facing is how to join the commands using the ' | ' symbol or similar solution. //Original Command var command='keytool -exportcert -storepass mypass -keypass mypass …
32
votes
3 answers

Import certificate as PrivateKeyEntry

I am installing SSL on a Tomcat server and am following these instructions from the issuer https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO16181 and it states: Verify the following…
bhttoan
  • 2,641
  • 5
  • 42
  • 71
31
votes
2 answers

How to create a certificate into a PKCS12 keystore with keytool?

I wanted to create a certificate into a PKCS12 keystore format with keytool program. The keystore has extension .pfx. How do I achieve this?
David García González
  • 5,164
  • 8
  • 29
  • 35
30
votes
4 answers

Find the alias name in the keystore file

I have a key store file cacerts under jre/lib/security in which i added a Certicate by using the import command. There are more than 50 certificates in my keystore. How do i find the alias name of the last imported certificate in the keystore. I…
user903676
  • 319
  • 1
  • 4
  • 10
30
votes
7 answers

Unable to import certificate to cacerts

My requirement is to import a certificate for maven repositories into the global keystore. The certificate file is named maven-cacert.cer . I am using following command from C:\Program Files\Java\jdk1.6.0_20\bin\ from cmd keytool -importcert…
Neha Shukla
  • 3,572
  • 5
  • 38
  • 69
28
votes
6 answers

Jarsigner: certificate chain not found for

I have imported a certificate into a private ~/.keystore file: keytool -list Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry mylyn-mantis, Jul 15, 2010, trustedCertEntry and am trying to sign a…
Robert Munteanu
  • 67,031
  • 36
  • 206
  • 278
28
votes
2 answers

Adding certificate chain to p12(pfx) certificate

I have aplication in java and cxf which connects to WebServices with client certificate. I got certificates form WebService owner certificate.p12 certificate.pem certificate.crt trusted_ca.cer root_ca.cer I have problem with straightforward…
bary
  • 1,699
  • 2
  • 15
  • 24
27
votes
2 answers

How to delete already import certificate/alias by keytool command?

I am trying to delete already import certificate by keytool command keytool -delete -noprompt -alias "initcert" -keystore keycloak.jks But getting below exception keytool error: java.lang.Exception: Keystore file does not exist: …
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
27
votes
2 answers

Difference between keytool -genkey vs -genkeypair

I am using keytool to create a CSR. I wonder what is the difference between the options -genkey and -genkeypair. My understanding is that -genkey creates only private key and -genkeypair creates both private and public key. If so, how do I get the…
Thiru
  • 381
  • 1
  • 3
  • 6
27
votes
3 answers

Android keystore corrupted

After a while of not updating my applications in the Play Store I tried to sign one of my APK with my keystore, only to find that the keystore and alias password doesn't work anymore. The keystore password I was able to reset using this gist:…
Niels Masdorp
  • 2,534
  • 2
  • 18
  • 31
27
votes
8 answers

Using an empty keystore password used to be possible?

When signing an apk after a long break from Android development I was surprised that I'm no longer able to enter an empty keystore password to unlock it. Is it just me or has this been possible before? If so, when did that change and how can I…
TomTasche
  • 5,448
  • 7
  • 41
  • 67
25
votes
2 answers

JAVA: how to obtain keystore file for a certification (crt) file

HI All, I have a .crt file and I need to get the associated keystore file. How to do so? Is keytool is helpful in that? Thanks.
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
24
votes
3 answers

keytool error: java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified

Book-Pro:main vy$ keytool -exportcert -list -v \ > -alias androiddebugkey -keystore ~/.android/debug.keystore keytool error: java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified. I am trying to create a SHA1…
IrishGringo
  • 3,864
  • 7
  • 37
  • 49