Package com.saperion.config
Class TrustedApplicationsUtility
- java.lang.Object
-
- com.saperion.config.TrustedApplicationsUtility
-
public class TrustedApplicationsUtility extends java.lang.Object
This singleton class provides the behavior to validate and generate application signature. It reads the clients.properties to keep a list of configured trusted applications.- Author:
- schowdhury
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TrustedApplicationsUtility
getInstance()
Get instance ofTrustedApplicationsUtility
to authorize Clients of JCSboolean
isTrustedApplicationsConfigured()
Return whether trusted applications are configured or notboolean
validateSignature(java.lang.Object payload, java.lang.String signature)
Returns true if the payload and signature is coming from a trusted application, false otherwise
-
-
-
Method Detail
-
getInstance
public static TrustedApplicationsUtility getInstance()
Get instance ofTrustedApplicationsUtility
to authorize Clients of JCS- Returns:
- instance of
TrustedApplicationsUtility
-
validateSignature
public boolean validateSignature(java.lang.Object payload, java.lang.String signature)
Returns true if the payload and signature is coming from a trusted application, false otherwise- Parameters:
payload
- payload received from clientsignature
- Signature received from client- Returns:
- true if the payload and signature is coming from a registered application, false otherwise
-
isTrustedApplicationsConfigured
public boolean isTrustedApplicationsConfigured()
Return whether trusted applications are configured or not- Returns:
- true if configured, false otherwise
-
-