Class SNSVerifier
java.lang.Object
org.deltava.crypt.SNSVerifier
A utility class to verify Amazon SNS messages.
- Since:
- 8.5
- Version:
- 11.1
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Certificate
loadCertificate
(String url) Loads an X.509 certificate from a URL.static boolean
validate
(org.json.JSONObject jo) Validates an SNS message.
-
Constructor Details
-
SNSVerifier
public SNSVerifier()
-
-
Method Details
-
loadCertificate
public static Certificate loadCertificate(String url) throws IOException, CertificateException, URISyntaxException Loads an X.509 certificate from a URL.- Parameters:
url
- the URL- Returns:
- the Certificate
- Throws:
IOException
- if the Certificate data cannot be retrievedCertificateException
- if the Certificate cannot be parseURISyntaxException
- if the URL cannot be parsed
-
validate
public static boolean validate(org.json.JSONObject jo) Validates an SNS message.- Parameters:
jo
- a JSONObject with the payload- Returns:
- TRUE if valid, otherwise FALSE
-