Skip to content

Commit 69a2c0c

Browse files
committed
new comments are added after code review.
1 parent b8a0f0c commit 69a2c0c

4 files changed

Lines changed: 27 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,18 @@ Retry Pattern allows to retry sending a failed request and it will only work wit
182182

183183
## Changes
184184

185-
Version Cybersource-sdk-java 6.2.6 (OCT,2017)
185+
Version Cybersource-sdk-java 6.2.6 (JAN,2018)
186+
_______________________________
187+
1) Added certificateCacheEnabled optional feature. certificateCacheEnabled parameter is set to false (default is true), the p12 certificate of a merchant will be reloaded from filesystem every time a transaction is made.If the certificateCacheEnabled is true then only at the begining time certificate of a merchant will loaded from filesystem.
188+
2) Intreduced a new feature to check merchant .p12 certificate file validity at run time.If it is not valid and replaced at runtime then SDK will be able to reload the new certificate data into cache.
189+
3) Changed clientLibrary version to 6.2.6;
190+
191+
Version Cybersource-sdk-java 6.2.5 (OCT,2017)
186192
_______________________________
187193
1) Merchant cert to be read from JAVA key store. Flag is added to enable reading cert from Java keystore.
188194
2) Added Custom HttpClient feature. Merchants can use there own http client instead of defaults which comes with SDK.
189195
3) Http Client connection reuse issue.
190-
4) Changed clientLibrary version to 6.2.6; in 6.2.4 release it was missed. So, in 6.2.4 release, clientLibrary version was pointing to 6.2.3.
196+
4) Changed clientLibrary version to 6.2.5; in 6.2.4 release it was missed. So, in 6.2.4 release, clientLibrary version was pointing to 6.2.3.
191197
_______________________________
192198
Version Cybersource-sdk-java 6.2.4 (Dec 15, 2016)
193199
_______________________________

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ public Identity(MerchantConfig merchantConfig,X509Certificate x509Certificate, P
116116
setUpMerchant();
117117
}
118118

119+
/**
120+
* Replace of merchant certificate not happened at runtime then isValid method will return true and certificate reload will not happen.
121+
* But replace of merchant certificate happened at at runtime then isValid method will return false and certificate reload will happen.
122+
*/
123+
119124
public boolean isValid(File keyFile) {
120125

121126
boolean changeKeyFileStatus=(this.lastModifiedDate == keyFile.lastModified());

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ private static void initKeystore() throws KeyStoreException, CredentialException
6767
/**
6868
* Method loads the Merchant P12 key.
6969
* IMPORTANT :This change is made based on the assumptions that at point of time , a merchant will have only one P12 Key
70+
*
71+
*CertificateCacheEnabled : If it is true then only first time merchant p12 file will be loaded.
72+
* If it is false then every time merchant p12 file will be loaded.
73+
*
74+
*isValid() method checks : If this method returns true that means existing certificate is valid and reload of merchant p12 file will not happen.
75+
* : If method returns false that means existing certificate is not valid and reload of new merchant p12 file will happen.
76+
*
7077
* @param merchantConfig - Merchant Config
7178
* @param logger - logger instance
7279
* @throws SignException - Signature exception
@@ -76,10 +83,7 @@ private static void initKeystore() throws KeyStoreException, CredentialException
7683
* @throws CredentialException
7784
*/
7885
public static void loadMerchantP12File(MerchantConfig merchantConfig, Logger logger) throws SignException, SignEncryptException, ConfigException {
79-
80-
// Load the KeyStore and get the signing key and certificate
81-
// This change is made based on the assumptions that at point of time , a merchant will have only one P12 Key
82-
86+
8387
Identity identity=identities.get(merchantConfig.getMerchantID());
8488
if(!merchantConfig.isCertificateCacheEnabled() || identity == null || !(identity.isValid(merchantConfig.getKeyFile()))){
8589
try {

zip/README

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ Mock objects library for java
199199

200200
##Changes
201201

202+
Version Cybersource-sdk-java 6.2.6 (JAN,2018)
203+
_______________________________
204+
1) Added certificateCacheEnabled optional feature. certificateCacheEnabled parameter is set to false (default is true), the p12 certificate of a merchant will be reloaded from filesystem every time a transaction is made.If the certificateCacheEnabled is true then only at the begining time certificate of a merchant will loaded from filesystem.
205+
2) Intreduced a new feature to check merchant .p12 certificate file validity at run time.If it is not valid and replaced at runtime then SDK will be able to reload the new certificate data into cache.
206+
3) Changed clientLibrary version to 6.2.6;
207+
202208
Version Cybersource-sdk-java 6.2.5 (OCT,2017)
203209
_______________________________
204210
1) Merchant cert to be read from JAVA key store. Flag is added to enable reading cert from Java keystore.

0 commit comments

Comments
 (0)