Package org.alfresco.encryption
Interface EncryptionUtils
-
- All Known Implementing Classes:
DefaultEncryptionUtils
public interface EncryptionUtils
Various encryption utility methods.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.boolean
authenticateResponse(org.apache.commons.httpclient.HttpMethod method, java.lang.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, java.security.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, java.security.AlgorithmParameters params)
Sets authentication headers on the HTTP response.
-
-
-
Method Detail
-
decryptResponseBody
byte[] decryptResponseBody(org.apache.commons.httpclient.HttpMethod method) throws java.io.IOException
Decrypt the response body of the http method- Parameters:
method
-- Returns:
- decrypted response body
- Throws:
java.io.IOException
-
decryptBody
byte[] decryptBody(javax.servlet.http.HttpServletRequest req) throws java.io.IOException
Decrypt the body of the http request- Parameters:
req
-- Returns:
- decrypted response body
- Throws:
java.io.IOException
-
authenticateResponse
boolean authenticateResponse(org.apache.commons.httpclient.HttpMethod method, java.lang.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 java.io.IOException
Encrypt the http method request body- Parameters:
method
-message
-- Throws:
java.io.IOException
-
setResponseAuthentication
void setResponseAuthentication(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, byte[] responseBody, java.security.AlgorithmParameters params) throws java.io.IOException
Sets authentication headers on the HTTP response.- Parameters:
httpRequest
-httpResponse
-responseBody
-params
-- Throws:
java.io.IOException
-
setRequestAlgorithmParameters
void setRequestAlgorithmParameters(org.apache.commons.httpclient.HttpMethod method, java.security.AlgorithmParameters params) throws java.io.IOException
Set the algorithm parameters header on the method request- Parameters:
method
-params
-- Throws:
java.io.IOException
-
-