Package org.alfresco.encryption
Interface EncryptionUtils
-
- All Known Implementing Classes:
DefaultEncryptionUtils
public interface EncryptionUtilsVarious encryption utility methods.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanauthenticate(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.booleanauthenticateResponse(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 methodvoidsetRequestAlgorithmParameters(org.apache.commons.httpclient.HttpMethod method, AlgorithmParameters params)Set the algorithm parameters header on the method requestvoidsetRequestAuthentication(org.apache.commons.httpclient.HttpMethod method, byte[] message)Encrypt the http method request bodyvoidsetResponseAuthentication(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, byte[] responseBody, AlgorithmParameters params)Sets authentication headers on the HTTP response.
-
-
-
Method Detail
-
decryptResponseBody
byte[] decryptResponseBody(org.apache.commons.httpclient.HttpMethod method) throws IOExceptionDecrypt the response body of the http method- Parameters:
method-- Returns:
- decrypted response body
- Throws:
IOException
-
decryptBody
byte[] decryptBody(javax.servlet.http.HttpServletRequest req) throws IOExceptionDecrypt 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 IOExceptionEncrypt 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 IOExceptionSets 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 IOExceptionSet the algorithm parameters header on the method request- Parameters:
method-params-- Throws:
IOException
-
-