PFX to JKS keytool conversion: Alias <*> does not exist

后端 未结 4 935
一个人的身影
一个人的身影 2021-01-04 18:57

I\'m trying to convert x.PFX file to x.JKS file using keytool but I am getting following error:

keytool error: java.lang.Exception: Alias <2> does not          


        
相关标签:
4条回答
  • 2021-01-04 19:16

    Maybe "2" can't be found, because there are whitespaces included (e.g. "2 ")

    If you don't wanna change the alias just remove the options -srcalias and -destalias and it will be imported with the original alias.

    0 讨论(0)
  • 2021-01-04 19:21

    I had the exact same problem. I've solved using '1' instead of 2. Don't know why but it worked.

    0 讨论(0)
  • 2021-01-04 19:22

    your command should looks a bit more like this

    keytool -importkeystore -srckeystore x.pfx -srcstoretype pkcs12 -***alias*** 2 -destkeystore x.jks -deststoretype jks -destalias xyz
    
    0 讨论(0)
  • 2021-01-04 19:25

    if set alias in pkcs12:

    openssl pkcs12 -export -in certificate.pem -inkey private_key.pem -out keystore.p12 -name "myalias"
    

    aftet alias setted successfully:

    keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore keystore.jks -deststoretype JKS -alias myalias
    
    0 讨论(0)
提交回复
热议问题