Skip to content

Commit de1f4ae

Browse files
Merge pull request #81 from CyberSource/future
includes changes to java keystore
2 parents f94d4d0 + e7a6790 commit de1f4ae

37 files changed

+2415
-1449
lines changed

README.md

Lines changed: 171 additions & 219 deletions
Large diffs are not rendered by default.

java/pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,22 @@
174174
</profiles>
175175

176176
<dependencies>
177-
<dependency>
177+
<dependency>
178178
<groupId>junit</groupId>
179179
<artifactId>junit</artifactId>
180180
<version>4.12</version>
181181
<scope>test</scope>
182182
</dependency>
183+
<dependency>
184+
<groupId>xalan</groupId>
185+
<artifactId>xalan</artifactId>
186+
<version>2.7.2</version>
187+
</dependency>
188+
<dependency>
189+
<groupId>org.apache.santuario</groupId>
190+
<artifactId>xmlsec</artifactId>
191+
<version>1.4.3</version>
192+
</dependency>
183193
<dependency>
184194
<groupId>commons-httpclient</groupId>
185195
<artifactId>commons-httpclient</artifactId>

java/src/main/java/com/cybersource/ws/client/Client.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,20 @@
2626
import org.xml.sax.InputSource;
2727
import org.xml.sax.SAXException;
2828

29+
import javax.security.cert.X509Certificate;
2930
import javax.xml.parsers.DocumentBuilder;
3031
import javax.xml.parsers.ParserConfigurationException;
3132

33+
import java.io.File;
34+
import java.io.FileInputStream;
3235
import java.io.IOException;
3336
import java.io.StringReader;
37+
import java.security.KeyStore;
38+
import java.security.cert.PKIXParameters;
39+
import java.security.cert.TrustAnchor;
3440
import java.text.MessageFormat;
3541
import java.util.HashMap;
42+
import java.util.Iterator;
3643
import java.util.Map;
3744
import java.util.Properties;
3845

@@ -191,8 +198,9 @@ private static Document soapWrapAndSign(
191198
logger.log(Logger.LT_INFO, "Client, End of soapWrap ",true);
192199

193200
Document resultDocument = null;
201+
194202
SecurityUtil.loadMerchantP12File(mc,logger);
195-
logger.log(Logger.LT_INFO, "Client, End of loadMerchantP12File ", true);
203+
logger.log(Logger.LT_INFO, "Client, End of loading Merchant Certificates ", true);
196204

197205
// sign Document object
198206
resultDocument = SecurityUtil.createSignedDoc(wrappedDoc, mc.getMerchantID(), mc.getKeyPassword(), logger);

0 commit comments

Comments
 (0)