Class KeyManager
- java.lang.Object
-
- io.mosip.authentication.common.service.integration.KeyManager
-
@Component public class KeyManager extends Object
The Class KeyManager is used to decipher the request and returning the decipher request to the filter to do further authentication.- Author:
- Sanjay Murali, Manoj SP
-
-
Constructor Summary
Constructors Constructor Description KeyManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
encryptData(Map<String,Object> responseBody, com.fasterxml.jackson.databind.ObjectMapper mapper)
Encrypt data.String
kernelDecrypt(String data, String refId, String aad, String salt)
Kernel decrypt.String
kernelDecryptAndDecode(String data, String refId)
Kernel decrypt and decode.Map<String,Object>
requestData(Map<String,Object> requestBody, com.fasterxml.jackson.databind.ObjectMapper mapper, String refId, ConsumerWithException<String,IdAuthenticationAppException> dataValidator)
requestData method used to decipher the request blockRequestDTO
present in AuthRequestDTOAuthRequestDTO
.String
signResponse(String data)
This method is used to digitally sign the response.
-
-
-
Method Detail
-
requestData
public Map<String,Object> requestData(Map<String,Object> requestBody, com.fasterxml.jackson.databind.ObjectMapper mapper, String refId, ConsumerWithException<String,IdAuthenticationAppException> dataValidator) throws IdAuthenticationAppException
requestData method used to decipher the request blockRequestDTO
present in AuthRequestDTOAuthRequestDTO
.- Parameters:
requestBody
- the request bodymapper
- the mapperrefId
- the ref idreqHMAC
-dataValidator
-- Returns:
- the map
- Throws:
IdAuthenticationAppException
- the id authentication app exceptionIdAuthenticationBusinessException
-
kernelDecryptAndDecode
public String kernelDecryptAndDecode(String data, String refId) throws IdAuthenticationAppException
Kernel decrypt and decode.- Parameters:
data
- the datarefId
- the ref id- Returns:
- the string
- Throws:
IdAuthenticationAppException
- the id authentication app exception
-
kernelDecrypt
public String kernelDecrypt(String data, String refId, String aad, String salt) throws IdAuthenticationAppException
Kernel decrypt.- Parameters:
data
- the datarefId
- the ref idaad
- the aadsalt
- the salt- Returns:
- the string
- Throws:
IdAuthenticationAppException
- the id authentication app exception
-
encryptData
public String encryptData(Map<String,Object> responseBody, com.fasterxml.jackson.databind.ObjectMapper mapper) throws IdAuthenticationAppException
Encrypt data.- Parameters:
responseBody
- the response bodymapper
- the mapper- Returns:
- the string
- Throws:
IdAuthenticationAppException
- the id authentication app exception
-
signResponse
public String signResponse(String data) throws IdAuthenticationAppException
This method is used to digitally sign the response.- Parameters:
data
- the response got after authentication which to be signed- Returns:
- the signed response string
- Throws:
IdAuthenticationAppException
- the id authentication app exception
-
-