Jarsigner: certificate chain not found for

前端 未结 4 1521
日久生厌
日久生厌 2021-02-07 00:00

I have imported a certificate into a private ~/.keystore file:

keytool -list
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Yo         


        
4条回答
  •  感情败类
    2021-02-07 00:03

    I faced same issue. I am having .p12 file issued by CA and I was trying to sign jar file. However I was getting error:

    jarsigner: Certificate chain not found for:
    

    Basically I was copying alias name from console. It was having wrong character 'question mark' (?) causing this error. Instead I redirected output of keytool to text file and then I copied alias name from there.

    1. Issue this command:

      keytool -list -v -storetype pkcs12 -keystore "mycertificate.p12" > cert.txt

    (This is very important. Always redirect to txt file. Do not copy from console output. It can contain wrong characters)

    1. Find out alias name in certificate. Open cert.txt and copy string as it is mentioned in front of "Alias name:"

    Let's say this string is "my alias name, a.p.’s my ca limited id"

    1. Use jarsigner:

      jarsigner -storetype pkcs12 -keystore "mycertificate.p12" myjarfile.jar "my alias name, a.p.’s my ca limited id"

提交回复
热议问题