Skip to content

Commit 10f81c6

Browse files
Javadoc - for methods
1 parent 5dca508 commit 10f81c6

3 files changed

Lines changed: 47 additions & 7 deletions

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ public static String maskIfNotSafe(int type, String field, String val) {
238238
return isSafe(type, field) ? val : mask(field, val);
239239
}
240240

241-
// the masking rules in this method were per Jason Hengels.
241+
/**
242+
* Mask the data.The masking rules in this method were per Jason Hengels.
243+
* @param field
244+
* @param val
245+
* @return
246+
*/
242247
public static String mask(String field, String val) {
243248
int len = val != null ? val.length() : 0;
244249
if (len == 0) return "";

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

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ else if(merchantConfig.isCacertEnabled()){
107107
}
108108

109109
/**
110-
*Reads the Certificate or Public key and Private from the P12 key .
110+
* Reads the Certificate or Public key and Private from the P12 key .
111111
* @param merchantConfig - Merchant Config details
112112
* @param logger - logger object
113113
* @throws SignException
@@ -176,8 +176,17 @@ private static void readAndStoreCertificateAndPrivateKey(MerchantConfig merchant
176176
throw new SignException(e);
177177
}
178178
}
179-
180-
179+
180+
181+
/**
182+
* Create signed encrypted document
183+
* @param signedDoc
184+
* @param merchantId
185+
* @param logger
186+
* @return Document
187+
* @throws SignEncryptException
188+
* @throws SignException
189+
*/
181190
public static Document handleMessageCreation(Document signedDoc, String merchantId, Logger logger) throws SignEncryptException, SignException{
182191

183192
logger.log(Logger.LT_INFO, "Encrypting Signed doc ...");
@@ -225,7 +234,16 @@ public static Document handleMessageCreation(Document signedDoc, String merchant
225234
encrBuilder.prependToHeader(secHeader);
226235
return signedEncryptedDoc;
227236
}
228-
237+
238+
/**
239+
* Create signed document
240+
* @param workingDocument
241+
* @param keyAlias
242+
* @param password
243+
* @param logger
244+
* @return Document
245+
* @throws SignException
246+
*/
229247
public static Document createSignedDoc(Document workingDocument,String keyAlias, String password,Logger logger) throws SignException {
230248

231249
logger.log(Logger.LT_INFO, "Signing request...");
@@ -261,8 +279,15 @@ public static Document createSignedDoc(Document workingDocument,String keyAlias,
261279
throw new SignException(e.getMessage());
262280
}
263281
}
264-
265-
282+
283+
284+
/**
285+
* read jdk certificates from cacerts file
286+
* @param merchantConfig
287+
* @param logger
288+
* @throws SignEncryptException
289+
* @throws SignException
290+
*/
266291
public static void readJdkCert(MerchantConfig merchantConfig, Logger logger)
267292
throws SignEncryptException, SignException {
268293
KeyStore keystore;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,20 @@ public static Element createElement(
513513
return (elem);
514514
}
515515

516+
/**
517+
* get response issued time in seconds
518+
* @param responseTime
519+
* @return long
520+
*/
516521
public static long getResponseIssuedAtTimeInSecs(String responseTime) {
517522
return parseLong(responseTime, 0L);
518523
}
519524

525+
/**
526+
* get response transit time in seconds
527+
* @param issuedAtTimeSeconds
528+
* @return long
529+
*/
520530
public static long getResponseTransitTimeSeconds(long issuedAtTimeSeconds) {
521531
if (issuedAtTimeSeconds > 0) {
522532
return (System.currentTimeMillis() / 1000) - issuedAtTimeSeconds;

0 commit comments

Comments
 (0)