Package io.mosip.mimoto.service.impl
Class CredentialShareServiceImpl
- java.lang.Object
-
- io.mosip.mimoto.service.impl.CredentialShareServiceImpl
-
- All Implemented Interfaces:
CredentialShareService
@Service public class CredentialShareServiceImpl extends Object implements CredentialShareService
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLICANT_PHOTOThe Constant APPLICANT_PHOTO.AuditLogRequestBuilderauditLogRequestBuilderThe core audit request builder.static StringCARD_JSON_FILE_NAMECbeffUtilcbeffutilThe cbeffutil.CryptoCoreUtilcryptoCoreUtilDataShareUtildataShareUtilstatic StringDATETIME_PATTERNThe Constant DATETIME_PATTERN.org.springframework.core.env.EnvironmentenvThe env.static StringEVENT_JSON_FILE_NAMEstatic StringFACEThe Constant FACE.static StringFILE_SEPARATORThe Constant FILE_SEPARATOR.static StringFINGERThe Constant FINGER.static StringINDIVIDUAL_BIOMETRICSThe Constant INDIVIDUAL_BIOMETRICS.static StringMASKED_UIN_CARD_TEMPLATEThe Constant MASKED_UIN_CARD_TEMPLATE.static StringNAMEStringpartnerIdio.mosip.kernel.core.websub.spi.PublisherClient<String,Object,org.springframework.http.HttpHeaders>pbStringpolicyIdstatic StringREG_PROC_APPLICATION_VERSIONThe Constant REG_PROC_APPLICATION_VERSION.RestApiClientrestApiClientRestClientService<Object>restClientServiceThe rest client service.StringsupportedLangStringtemplateLangStringtopicstatic StringUIN_CARD_TEMPLATEThe Constant UIN_CARD_TEMPLATE.static StringUIN_TEXT_FILEThe Constant UIN_TEXT_FILE.static StringUINCARDPASSWORDThe Constant UINCARDPASSWORD.UtilitiesutilitiesThe utilities.static StringVALUEThe Constant VALUE.static StringVC_JSON_FILE_NAMEstatic StringVC_REQUEST_FILE_NAMEstatic StringVID_CREATE_IDThe Constant VID_CREATE_ID.static StringVID_TYPEWebSubSubscriptionHelperwebSubSubscriptionHelper
-
Constructor Summary
Constructors Constructor Description CredentialShareServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]createJSONFile(org.json.JSONObject credential, String individualBiometric, Map<String,Object> attributes)org.json.JSONObjectdecrypt(String credential, String credentialSubject, String encryptionPin)org.json.JSONObjectdecryptAttribute(org.json.JSONObject data, String encryptionPin, String credential)Decrypt protected (encrypted) attributes.byte[]extractFaceImageData(byte[] decodedBioValue)booleangenerateDocuments(EventModel eventModel)Generate documents from websub event model.org.json.JSONObjectgetBiometricsDataJSON(String individualBiometric, Map<String,Object> attributes)Decode biometrics data from CBEFF and return biometrics JSON object.StringgetCredentialSubject(String credential)Map<String,byte[]>getDocuments(org.json.JSONObject credentialJSON, String credentialType, String requestId, String sign)StringgetSignature(String sign, String credential)voidsetTemplateAttributes(String jsonString, Map<String,Object> attribute)Gets the artifacts.voidstatusUpdate(String requestId, byte[] data, String credentialType)Create datashare and update printing status via websub.
-
-
-
Field Detail
-
VC_REQUEST_FILE_NAME
public static final String VC_REQUEST_FILE_NAME
- See Also:
- Constant Field Values
-
EVENT_JSON_FILE_NAME
public static final String EVENT_JSON_FILE_NAME
- See Also:
- Constant Field Values
-
VC_JSON_FILE_NAME
public static final String VC_JSON_FILE_NAME
- See Also:
- Constant Field Values
-
CARD_JSON_FILE_NAME
public static final String CARD_JSON_FILE_NAME
- See Also:
- Constant Field Values
-
FINGER
public static final String FINGER
The Constant FINGER.- See Also:
- Constant Field Values
-
topic
public String topic
-
webSubSubscriptionHelper
@Autowired public WebSubSubscriptionHelper webSubSubscriptionHelper
-
dataShareUtil
@Autowired public DataShareUtil dataShareUtil
-
restApiClient
@Autowired public RestApiClient restApiClient
-
cryptoCoreUtil
@Autowired public CryptoCoreUtil cryptoCoreUtil
-
FILE_SEPARATOR
public static final String FILE_SEPARATOR
The Constant FILE_SEPARATOR.
-
VALUE
public static final String VALUE
The Constant VALUE.- See Also:
- Constant Field Values
-
UIN_CARD_TEMPLATE
public static final String UIN_CARD_TEMPLATE
The Constant UIN_CARD_TEMPLATE.- See Also:
- Constant Field Values
-
MASKED_UIN_CARD_TEMPLATE
public static final String MASKED_UIN_CARD_TEMPLATE
The Constant MASKED_UIN_CARD_TEMPLATE.- See Also:
- Constant Field Values
-
FACE
public static final String FACE
The Constant FACE.- See Also:
- Constant Field Values
-
UIN_TEXT_FILE
public static final String UIN_TEXT_FILE
The Constant UIN_TEXT_FILE.- See Also:
- Constant Field Values
-
APPLICANT_PHOTO
public static final String APPLICANT_PHOTO
The Constant APPLICANT_PHOTO.- See Also:
- Constant Field Values
-
UINCARDPASSWORD
public static final String UINCARDPASSWORD
The Constant UINCARDPASSWORD.- See Also:
- Constant Field Values
-
auditLogRequestBuilder
@Autowired public AuditLogRequestBuilder auditLogRequestBuilder
The core audit request builder.
-
utilities
@Autowired public Utilities utilities
The utilities.
-
restClientService
@Autowired public RestClientService<Object> restClientService
The rest client service.
-
INDIVIDUAL_BIOMETRICS
public static final String INDIVIDUAL_BIOMETRICS
The Constant INDIVIDUAL_BIOMETRICS.- See Also:
- Constant Field Values
-
VID_CREATE_ID
public static final String VID_CREATE_ID
The Constant VID_CREATE_ID.- See Also:
- Constant Field Values
-
REG_PROC_APPLICATION_VERSION
public static final String REG_PROC_APPLICATION_VERSION
The Constant REG_PROC_APPLICATION_VERSION.- See Also:
- Constant Field Values
-
DATETIME_PATTERN
public static final String DATETIME_PATTERN
The Constant DATETIME_PATTERN.- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
VID_TYPE
public static final String VID_TYPE
- See Also:
- Constant Field Values
-
cbeffutil
@Autowired public CbeffUtil cbeffutil
The cbeffutil.
-
env
@Autowired public org.springframework.core.env.Environment env
The env.
-
pb
@Autowired public io.mosip.kernel.core.websub.spi.PublisherClient<String,Object,org.springframework.http.HttpHeaders> pb
-
partnerId
@Value("${mosip.datashare.partner.id}") public String partnerId
-
policyId
@Value("${mosip.datashare.policy.id}") public String policyId
-
templateLang
@Value("${mosip.template-language}") public String templateLang
-
supportedLang
@Value("#{\'${mosip.mandatory-languages:}\'.concat(\'${mosip.optional-languages:}\')}") public String supportedLang
-
-
Method Detail
-
generateDocuments
public boolean generateDocuments(EventModel eventModel) throws Exception
Description copied from interface:CredentialShareServiceGenerate documents from websub event model.- Specified by:
generateDocumentsin interfaceCredentialShareService- Returns:
- Throws:
Exception
-
decrypt
public org.json.JSONObject decrypt(String credential, String credentialSubject, String encryptionPin)
-
getDocuments
public Map<String,byte[]> getDocuments(org.json.JSONObject credentialJSON, String credentialType, String requestId, String sign)
-
createJSONFile
public byte[] createJSONFile(org.json.JSONObject credential, String individualBiometric, Map<String,Object> attributes) throws IOException- Throws:
IOException
-
getBiometricsDataJSON
public org.json.JSONObject getBiometricsDataJSON(String individualBiometric, Map<String,Object> attributes)
Decode biometrics data from CBEFF and return biometrics JSON object.- Parameters:
individualBiometric-attributes-- Returns:
-
setTemplateAttributes
public void setTemplateAttributes(String jsonString, Map<String,Object> attribute) throws IOException, org.json.simple.parser.ParseException
Gets the artifacts.- Parameters:
idJsonString- the id json stringattribute- the attribute- Throws:
IOException- Signals that an I/O exception has occurred.org.json.simple.parser.ParseException
-
extractFaceImageData
public byte[] extractFaceImageData(byte[] decodedBioValue)
-
statusUpdate
public void statusUpdate(String requestId, byte[] data, String credentialType) throws DataShareException, ApiNotAccessibleException, IOException, Exception
Create datashare and update printing status via websub. Should be call at the end of the event handler section.- Parameters:
requestId-data-credentialType-- Throws:
DataShareExceptionApiNotAccessibleExceptionIOExceptionException
-
decryptAttribute
public org.json.JSONObject decryptAttribute(org.json.JSONObject data, String encryptionPin, String credential) throws org.json.simple.parser.ParseExceptionDecrypt protected (encrypted) attributes.- Parameters:
data-encryptionPin-credential-- Returns:
- Throws:
org.json.simple.parser.ParseException
-
-