Skip to content

Commit b8a0f0c

Browse files
committed
added a logger into isValid method to print the new certificate last modified date in case of certificate got expired and replaced otherwise log won't print.
1 parent 0798931 commit b8a0f0c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@ public Identity(MerchantConfig merchantConfig,X509Certificate x509Certificate, P
117117
}
118118

119119
public boolean isValid(File keyFile) {
120+
121+
boolean changeKeyFileStatus=(this.lastModifiedDate == keyFile.lastModified());
120122

121-
if (this.lastModifiedDate == keyFile.lastModified()) {
123+
if (!changeKeyFileStatus) {
122124

123-
logger.log(Logger.LT_INFO, "key files not yet changed");
124-
logger.log(Logger.LT_INFO, "Timestamp of Current file:"+this.lastModifiedDate);
125+
logger.log(Logger.LT_INFO, "Key file changed");
126+
logger.log(Logger.LT_INFO, "Timestamp of current key file:"+this.lastModifiedDate);
125127
}
126-
return this.lastModifiedDate == keyFile.lastModified();
128+
return changeKeyFileStatus;
127129
}
128130

129131
private void setUpMerchant() throws SignException {

0 commit comments

Comments
 (0)