Package net.solarnetwork.web.security
Class AuthenticationUtils
java.lang.Object
net.solarnetwork.web.security.AuthenticationUtils
Utility methods for authentication support.
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final byte[]computeMACDigest(byte[] secretKey, byte[] data, String macAlgorithm) Compute a Base64 MAC digest from signature data.static final byte[]computeMACDigest(byte[] secretKey, String data, String macAlgorithm) Compute a Base64 MAC digest from signature data.static final byte[]computeMACDigest(String secretKey, String data, String macAlgorithm) Compute a Base64 MAC digest from signature data.static StringGet a HTTP formatted date.static Stringiso8601Date(Date date) Get an ISO8601 formatted date.static StringuriEncode(CharSequence input) AWS style implementation of "uri encoding" using UTF-8 encoding.
-
Constructor Details
-
AuthenticationUtils
public AuthenticationUtils()
-
-
Method Details
-
httpDate
Get a HTTP formatted date.- Parameters:
date- The date to format.- Returns:
- The formatted date.
-
iso8601Date
Get an ISO8601 formatted date.- Parameters:
date- The date to format.- Returns:
- The formatted date.
-
uriEncode
AWS style implementation of "uri encoding" using UTF-8 encoding.- Parameters:
input- The text input to encode.- Returns:
- The URI escaped string.
-
computeMACDigest
Compute a Base64 MAC digest from signature data.- Parameters:
secretKey- the secret keydata- the data to signmacAlgorithm- the MAC algorithm to use- Returns:
- The base64 encoded digest.
- Throws:
SecurityException- if any error occurs
-
computeMACDigest
Compute a Base64 MAC digest from signature data.- Parameters:
secretKey- the secret keydata- the data to signmacAlgorithm- the MAC algorithm to use- Returns:
- The base64 encoded digest.
- Throws:
SecurityException- if any error occurs
-
computeMACDigest
Compute a Base64 MAC digest from signature data.- Parameters:
secretKey- the secret keydata- the data to signmacAlgorithm- the MAC algorithm to use- Returns:
- The base64 encoded digest.
- Throws:
SecurityException- if any error occurs
-