[SalesForce] Import keystore in Certificate and Key Management

I'm trying to import a keystore that contains my certificate into Salesforce.com, but when I'm importing it doesn't appear. I'm doing something wrong?

  1. I generated my keystore with this command:

    keytool -keystore moran1.jks -alias serverkey -import -file *.sedeb2b.com.cer -trustcacerts

  2. In Salesforce.com I'm selecting the jks file generated and I'm entering the password.
    enter image description here

  3. When I click save, nothing happens.

What could be the best practice? I want to connect salesforce with this webservice:
https://cfdiws.sedeb2b.com/EdiwinWS/services/CFDi?wsdl

When I invoke my function from visualforce this is the error:

enter image description here

Best Answer

Maybe I'm resurrecting an old thread, but today I find out I also couldn't import a JKS in Salesforce as it was throwing:

The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page.

What I discovered is that in order to import a JKS, there are some prerequisites that Salesforce haven't documented, but rather I found out from reading through the developer forum. It turns out you need to:

  1. Create a self-signed certificate (for the sake of it)
  2. Enable "Identity Provider"
  3. Import the JKS
  4. (Optional) Disable "Identity Provider"
  5. (Optional) Delete the self-signed certificate

In addition, if you have the certificate and the private key, you can use the following commands (OS X) in order to create a keystore (JKS) and add the cert:

openssl pkcs12 -export -in CERTIFICATEFILE -inkey PRIVATEKEYFILE -certfile CERTIFICATEFILE -out keystore.p12

and then

keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore YOURJKSNAME.jks -deststoretype JKS

Related Topic