Package edu.uiuc.ncsa.sas.thing.response
Class ResponseSerializer
- java.lang.Object
-
- edu.uiuc.ncsa.sas.thing.response.ResponseSerializer
-
- All Implemented Interfaces:
SASConstants
public class ResponseSerializer extends Object implements SASConstants
Created by Jeff Gaynor
on 8/16/22 at 6:26 AM
-
-
Field Summary
-
Fields inherited from interface edu.uiuc.ncsa.sas.SASConstants
ACTION_EXECUTE, ACTION_INVOKE, ACTION_LOGOFF, ACTION_LOGON, ACTION_NEW_KEY, CLIENT_ID_HEAD, HEADER_SESSION_ID, KEYS_ACTION, KEYS_ARGUMENT, KEYS_COMMENT, KEYS_EXECUTABLE_NAME, KEYS_INTERNAL_ID, KEYS_METHOD, KEYS_PROMPT, KEYS_SAS, KEYS_STATE, KEYS_SUBJECT, KEYS_SUBJECT_ID, KEYS_SUBJECT_SESSION_ID, KEYS_TYPE, REQUEST_TYPE, RESPONSE_CONTENT, RESPONSE_MESSAGE, RESPONSE_PROMPT, RESPONSE_SESSION_ID, RESPONSE_STATUS, RESPONSE_STATUS_ERROR, RESPONSE_STATUS_OK, RESPONSE_SYMMETRIC_KEY, RESPONSE_TYPE, RESPONSE_TYPE_ERROR, RESPONSE_TYPE_LOGOFF, RESPONSE_TYPE_LOGON, RESPONSE_TYPE_NEW_KEY, RESPONSE_TYPE_OUTPUT, RESPONSE_TYPE_PROMPT
-
-
Constructor Summary
Constructors Constructor Description ResponseSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
rsaEncrypt(PublicKey publicKey, String x)
protected String
sEncrypt(byte[] key, String x)
Symmetric key encode.void
serialize(LogonResponse logonResponse, javax.servlet.http.HttpServletResponse servletResponse, SessionRecord sessionRecord)
This is an outlier in the sense that there is only exactly one logon request and it must have its resposne RSA encrypted.void
serialize(Throwable throwable, javax.servlet.http.HttpServletResponse servletResponse, SessionRecord sessionRecord)
void
serialize(List<Response> responses, javax.servlet.http.HttpServletResponse servletResponse, SessionRecord sessionRecord)
protected void
setResponseState(Response response, net.sf.json.JSONObject jsonObject)
-
-
-
Method Detail
-
sEncrypt
protected String sEncrypt(byte[] key, String x)
Symmetric key encode. Returned string is base 64 encoded byte array.- Parameters:
key
-x
-- Returns:
-
serialize
public void serialize(LogonResponse logonResponse, javax.servlet.http.HttpServletResponse servletResponse, SessionRecord sessionRecord) throws IOException
This is an outlier in the sense that there is only exactly one logon request and it must have its resposne RSA encrypted.- Parameters:
logonResponse
-servletResponse
-sessionRecord
-- Throws:
IOException
-
serialize
public void serialize(Throwable throwable, javax.servlet.http.HttpServletResponse servletResponse, SessionRecord sessionRecord) throws IOException
- Throws:
IOException
-
setResponseState
protected void setResponseState(Response response, net.sf.json.JSONObject jsonObject)
-
serialize
public void serialize(List<Response> responses, javax.servlet.http.HttpServletResponse servletResponse, SessionRecord sessionRecord) throws IOException
- Throws:
IOException
-
-