Package org.alfresco.encryption
Interface EncryptionUtils
- All Known Implementing Classes:
DefaultEncryptionUtils
public interface EncryptionUtils
Various encryption utility methods.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(javax.servlet.http.HttpServletRequest req, byte[] decryptedBody) Authenticate the http request: validate the MAC, check that the remote IP is as expected and that the timestamp is recent.boolean
authenticateResponse
(org.apache.commons.httpclient.HttpMethod method, String remoteIP, byte[] decryptedBody) Authenticate the http method response: validate the MAC, check that the remote IP is as expected and that the timestamp is recent.byte[]
decryptBody
(javax.servlet.http.HttpServletRequest req) Decrypt the body of the http requestbyte[]
decryptResponseBody
(org.apache.commons.httpclient.HttpMethod method) Decrypt the response body of the http methodvoid
setRequestAlgorithmParameters
(org.apache.commons.httpclient.HttpMethod method, AlgorithmParameters params) Set the algorithm parameters header on the method requestvoid
setRequestAuthentication
(org.apache.commons.httpclient.HttpMethod method, byte[] message) Encrypt the http method request bodyvoid
setResponseAuthentication
(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, byte[] responseBody, AlgorithmParameters params) Sets authentication headers on the HTTP response.
-
Method Details
-
decryptResponseBody
Decrypt the response body of the http method- Parameters:
method
-- Returns:
- decrypted response body
- Throws:
IOException
-
decryptBody
Decrypt the body of the http request- Parameters:
req
-- Returns:
- decrypted response body
- Throws:
IOException
-
authenticateResponse
boolean authenticateResponse(org.apache.commons.httpclient.HttpMethod method, String remoteIP, byte[] decryptedBody) Authenticate the http method response: validate the MAC, check that the remote IP is as expected and that the timestamp is recent.- Parameters:
method
-remoteIP
-decryptedBody
-- Returns:
- true if the method reponse is authentic, false otherwise
-
authenticate
boolean authenticate(javax.servlet.http.HttpServletRequest req, byte[] decryptedBody) Authenticate the http request: validate the MAC, check that the remote IP is as expected and that the timestamp is recent.- Parameters:
req
-decryptedBody
-- Returns:
- true if the method request is authentic, false otherwise
-
setRequestAuthentication
void setRequestAuthentication(org.apache.commons.httpclient.HttpMethod method, byte[] message) throws IOException Encrypt the http method request body- Parameters:
method
-message
-- Throws:
IOException
-
setResponseAuthentication
void setResponseAuthentication(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, byte[] responseBody, AlgorithmParameters params) throws IOException Sets authentication headers on the HTTP response.- Parameters:
httpRequest
-httpResponse
-responseBody
-params
-- Throws:
IOException
-
setRequestAlgorithmParameters
void setRequestAlgorithmParameters(org.apache.commons.httpclient.HttpMethod method, AlgorithmParameters params) throws IOException Set the algorithm parameters header on the method request- Parameters:
method
-params
-- Throws:
IOException
-