CyberSource / cybersource-sdk-java

Java SDK for CyberSource Simple Order API
Other
51 stars 84 forks source link

Upgrade to Java SDK 6.2.13 from Cybsclients15.jar and new P12 keys... #179

Open huw-trimet opened 4 months ago

huw-trimet commented 4 months ago

Hello Community, we are upgrading to the new Java SDK using the RunSample.java and our own projects, I have consistent reproduce the following behaviors, please advise.

P12 keys created using a strong password vs P12 keys created with the "merchantid" being the password. All P12 keys are imported using the "Certificate Import Wizard"

In the RunSample.java run time, the P12 keys with a strong password, required the keyAlias property field being populated, otherwise, would result in error:

Exception in thread "main" java.lang.UnsupportedOperationException: trusted certificate entries are not password-protected at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:466) at java.security.KeyStore.getEntry(KeyStore.java:1521) at com.cybersource.ws.client.SecurityUtil.readAndStoreCertificateAndPrivateKey(SecurityUtil.java:158) at com.cybersource.ws.client.SecurityUtil.loadMerchantP12File(SecurityUtil.java:109) at com.cybersource.ws.client.Client.soapWrapAndSign(Client.java:231) at com.cybersource.ws.client.Client.runTransaction(Client.java:117) at com.cybersource.ws.client.Client.runTransaction(Client.java:67) at com.cybersource.sample.RunSample.runAuth(RunSample.java:153) at com.cybersource.sample.RunSample.main(RunSample.java:64) Command execution failed.

However, the P12 keys were generated with the password as the merchantid, can't have the keyAlias field populated, it would cause the error:

Exception while obtaining private key from KeyStore with alias,

Any insights would be appreciated.