Loading ePassport/ttcn/ePassport_Templates.ttcn +433 −366 Original line number Diff line number Diff line Loading @@ -2,10 +2,9 @@ * @author ETSI * @version $URL$ * $Id$ * @desc Collection of templates and constants. * @desc ePassport templates * */ module ePassport_Templates { //LibCommon Loading @@ -18,6 +17,10 @@ module ePassport_Templates { group automaticTestInterface { /** * @desc Receive template for verdict reports * @param v_failCode Verdict report code */ template CommandPutDataWith mw_report(template Oct2 v_failCode) := { class := mw_class_01, ins := e_putDataWithDataBytes, //'da'O, Loading @@ -34,6 +37,9 @@ module ePassport_Templates { lengthE := omit } /** * @desc Receive template for 'Get Certificate' */ template CommandGetData mw_getData_cert := { class := mw_class_01, ins := e_getData, Loading @@ -46,6 +52,9 @@ module ePassport_Templates { lengthE := ? } /** * @desc Receive template for 'Get Optical MRZ' */ template CommandGetData mw_getData_mrz := { class := mw_class_01, ins := e_getData, Loading @@ -58,34 +67,39 @@ module ePassport_Templates { lengthE := ? } /** * @desc Send template for Optical MRZ * @param p_mrzLine1 First line of optical MRZ * @param p_mrzLine2 Second line of optical MRZ */ template (value) PlainTextResponseData m_opticalMrz(in octetstring p_mrzLine1, in octetstring p_mrzLine2) := c_aisMrzLine1Tag & int2oct(lengthof(p_mrzLine1), 1) & p_mrzLine1 & c_aisMrzLine2Tag & int2oct(lengthof(p_mrzLine2), 1) & p_mrzLine2; /** * @desc Send templates for certificates IDs * @param p_certRefIds Certificate IDs */ template (value) PlainTextResponseData m_certRefIds(in octetstring p_certRefIds) := p_certRefIds; } // end automaticTestInterface template Class mw_class(integer p_channelNumber) := { first := { tag := c_firstInterindustryClass, chaining := e_lastOrOnlyCommand, sm := ?, //FIXME channelNumber := p_channelNumber } } /** * @desc Receive template for Class field on channel 0 */ template Class mw_class_00 := { first := { tag := c_firstInterindustryClass, chaining := e_lastOrOnlyCommand, sm := ?, //FIXME sm := ?, channelNumber := 0 } } /** * @desc Receive template Class field on channel 1 */ template Class mw_class_01 := { first := { tag := c_firstInterindustryClass, Loading @@ -97,7 +111,21 @@ module ePassport_Templates { group commandTemplates { //SELECT TEMPLATES : Send APDU to the passport 00 a4 04 0c 07 a0 00 00 02 47 10 01 /** * @desc Recieve template for any Command-APDU */ template CommandGeneric mw_genericCommand := { class := mw_class_00, ins := ?, params := ?, lengthC := *, payload := *, lengthE := * } /** * @desc Receive template for application selection */ template CommandSelect mw_selectApplication := { class := mw_class_00, ins := e_select, Loading @@ -117,6 +145,10 @@ module ePassport_Templates { lengthE := omit } /** * @desc Receive template for file selection using long file ID * @param v_fileID Long file ID of the file to be selected */ template CommandSelect mw_selectByFileId (LongFileId v_fileID) := { class := mw_class_00, ins := e_select, Loading @@ -136,6 +168,9 @@ module ePassport_Templates { lengthE := omit } /** * @desc Receive template for any file selection */ template CommandSelect mw_selectAnyFile := { class := mw_class_00, ins := e_select, Loading @@ -155,15 +190,10 @@ module ePassport_Templates { lengthE := omit } template CommandGeneric mw_genericCommand := { class := mw_class_00, ins := ?, params := ?, lengthC := *, payload := *, lengthE := * } /** * @desc Receive template for file reading using short file ID * @param v_fileID Short file ID of the file to be read */ template CommandReadBinary mw_readShortEF (ShortFileId p_shortFileId) := { class := mw_class_00, ins := e_readBinary, Loading @@ -180,6 +210,9 @@ module ePassport_Templates { lengthE := ? } /** * @desc Receive template for any file reading */ template CommandReadBinary mw_readAnyShortEF := { class := mw_class_00, ins := e_readBinary, Loading @@ -196,6 +229,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for reading current file */ template CommandReadBinary mw_readCurrentEF := { class := mw_class_00, ins := e_readBinary, Loading @@ -210,6 +246,10 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for reading current file using offset data object * @remark This command is used when offset gets big */ template CommandReadBinaryWithOffsetDataObject mw_readCurrentEFWithOffsetDataObject := { class := mw_class_00, ins := e_readBinaryWithOffsetDataObject, Loading @@ -225,6 +265,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Get Challenge' command */ template CommandGetChallenge mw_getChallenge := { class := mw_class_00, ins := e_getChallenge, Loading @@ -237,6 +280,9 @@ module ePassport_Templates { lengthE := ? } /** * @desc Receive template for 'External Authenticate' command */ template CommandExternalOrMutualAuthenticate mw_extAuthenticate := { class := mw_class_00, ins := e_externalOrMutualAuthenticate, Loading @@ -249,6 +295,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Internal Authenticate' command */ template CommandInternalAuthenticate mw_intAuthenticate := { class := mw_class_00, ins := e_internalAuthenticate, Loading @@ -261,6 +310,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Set Digital Signature Template' command */ template CommandManageSecurityEnvironment mw_mseSetDST := { class := mw_class_00, ins := e_manageSecurityEnvironment, Loading Loading @@ -290,6 +342,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Generic receive template for 'Set Key Authentication Template' command */ template CommandManageSecurityEnvironment mw_mseSetKAT := { class := mw_class_00, ins := e_manageSecurityEnvironment, Loading Loading @@ -326,18 +381,12 @@ module ePassport_Templates { lengthE := * } template CommandManageSecurityEnvironment mw_mseSetKAT_chipAuthentication := { class := mw_class_00, ins := e_manageSecurityEnvironment, params := { mseSecureMessagingInCommandDataField := ?, mseSecureMessagingInResponseDataField := ?, mseComputationDeciphermentIntAuthKeyAgreement := ?, mseVerificationEnciphermentExtAuthKeyAgreement := ?, mseFunction := e_mseFunctionSet, crtTag := e_crtKAT }, lengthC := ?, /** * @desc Receive template for 'Set Key Authentication Template' command as used in Chip Authentication * @see mw_mseSetKAT */ template CommandManageSecurityEnvironment mw_mseSetKAT_chipAuthentication modifies mw_mseSetKAT := { payload := { manageSecurityEnvironmentData := { crtKAT := { Loading @@ -358,10 +407,12 @@ module ePassport_Templates { crtUsageQualifierByte := omit } } }, lengthE := * } } /** * @desc Receive template for 'Set Authentication Template' command */ template CommandManageSecurityEnvironment mw_mseSetAT := { class := mw_class_00, ins := e_manageSecurityEnvironment, Loading Loading @@ -391,6 +442,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Verify Certificate' command */ template CommandPerformSecurityOperation mw_psoVerifyCertificate := { class := mw_class_00, ins := e_performSecurityOperation, Loading @@ -415,25 +469,38 @@ module ePassport_Templates { group responseTemplates { // Response OK /** * @desc Send template for response indicating Success */ template (value) Response m_responseOK := { responseData := omit, w1w2 := c_w1w2NormalProcessing } // Response NOK /** * @desc Send template for response indicating failure or warning * @param v_w1w2 Status code of the failure/warning */ template (value) Response m_responseNOK(W1W2Status v_w1w2) := { responseData := omit, w1w2 := v_w1w2 } // Response Data Template /** * @desc Send template for response to Read commands * @param v_data Read data */ template (value) Response m_responseRead(template (omit) PlainTextResponseData v_data) := { responseData := {plainText := v_data}, w1w2 := c_w1w2NormalProcessing } // Response Data Template /** * @desc end template for response to Read commands with specific status code * @param p_data Read data * @param p_w1w2 Error code of the failure/warning */ template (value) Response m_responseReadWithStatus(template (omit) PlainTextResponseData p_data, W1W2Status p_w1w2) := { responseData := {plainText := p_data}, w1w2 := p_w1w2 Loading Loading
ePassport/ttcn/ePassport_Templates.ttcn +433 −366 Original line number Diff line number Diff line Loading @@ -2,10 +2,9 @@ * @author ETSI * @version $URL$ * $Id$ * @desc Collection of templates and constants. * @desc ePassport templates * */ module ePassport_Templates { //LibCommon Loading @@ -18,6 +17,10 @@ module ePassport_Templates { group automaticTestInterface { /** * @desc Receive template for verdict reports * @param v_failCode Verdict report code */ template CommandPutDataWith mw_report(template Oct2 v_failCode) := { class := mw_class_01, ins := e_putDataWithDataBytes, //'da'O, Loading @@ -34,6 +37,9 @@ module ePassport_Templates { lengthE := omit } /** * @desc Receive template for 'Get Certificate' */ template CommandGetData mw_getData_cert := { class := mw_class_01, ins := e_getData, Loading @@ -46,6 +52,9 @@ module ePassport_Templates { lengthE := ? } /** * @desc Receive template for 'Get Optical MRZ' */ template CommandGetData mw_getData_mrz := { class := mw_class_01, ins := e_getData, Loading @@ -58,34 +67,39 @@ module ePassport_Templates { lengthE := ? } /** * @desc Send template for Optical MRZ * @param p_mrzLine1 First line of optical MRZ * @param p_mrzLine2 Second line of optical MRZ */ template (value) PlainTextResponseData m_opticalMrz(in octetstring p_mrzLine1, in octetstring p_mrzLine2) := c_aisMrzLine1Tag & int2oct(lengthof(p_mrzLine1), 1) & p_mrzLine1 & c_aisMrzLine2Tag & int2oct(lengthof(p_mrzLine2), 1) & p_mrzLine2; /** * @desc Send templates for certificates IDs * @param p_certRefIds Certificate IDs */ template (value) PlainTextResponseData m_certRefIds(in octetstring p_certRefIds) := p_certRefIds; } // end automaticTestInterface template Class mw_class(integer p_channelNumber) := { first := { tag := c_firstInterindustryClass, chaining := e_lastOrOnlyCommand, sm := ?, //FIXME channelNumber := p_channelNumber } } /** * @desc Receive template for Class field on channel 0 */ template Class mw_class_00 := { first := { tag := c_firstInterindustryClass, chaining := e_lastOrOnlyCommand, sm := ?, //FIXME sm := ?, channelNumber := 0 } } /** * @desc Receive template Class field on channel 1 */ template Class mw_class_01 := { first := { tag := c_firstInterindustryClass, Loading @@ -97,7 +111,21 @@ module ePassport_Templates { group commandTemplates { //SELECT TEMPLATES : Send APDU to the passport 00 a4 04 0c 07 a0 00 00 02 47 10 01 /** * @desc Recieve template for any Command-APDU */ template CommandGeneric mw_genericCommand := { class := mw_class_00, ins := ?, params := ?, lengthC := *, payload := *, lengthE := * } /** * @desc Receive template for application selection */ template CommandSelect mw_selectApplication := { class := mw_class_00, ins := e_select, Loading @@ -117,6 +145,10 @@ module ePassport_Templates { lengthE := omit } /** * @desc Receive template for file selection using long file ID * @param v_fileID Long file ID of the file to be selected */ template CommandSelect mw_selectByFileId (LongFileId v_fileID) := { class := mw_class_00, ins := e_select, Loading @@ -136,6 +168,9 @@ module ePassport_Templates { lengthE := omit } /** * @desc Receive template for any file selection */ template CommandSelect mw_selectAnyFile := { class := mw_class_00, ins := e_select, Loading @@ -155,15 +190,10 @@ module ePassport_Templates { lengthE := omit } template CommandGeneric mw_genericCommand := { class := mw_class_00, ins := ?, params := ?, lengthC := *, payload := *, lengthE := * } /** * @desc Receive template for file reading using short file ID * @param v_fileID Short file ID of the file to be read */ template CommandReadBinary mw_readShortEF (ShortFileId p_shortFileId) := { class := mw_class_00, ins := e_readBinary, Loading @@ -180,6 +210,9 @@ module ePassport_Templates { lengthE := ? } /** * @desc Receive template for any file reading */ template CommandReadBinary mw_readAnyShortEF := { class := mw_class_00, ins := e_readBinary, Loading @@ -196,6 +229,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for reading current file */ template CommandReadBinary mw_readCurrentEF := { class := mw_class_00, ins := e_readBinary, Loading @@ -210,6 +246,10 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for reading current file using offset data object * @remark This command is used when offset gets big */ template CommandReadBinaryWithOffsetDataObject mw_readCurrentEFWithOffsetDataObject := { class := mw_class_00, ins := e_readBinaryWithOffsetDataObject, Loading @@ -225,6 +265,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Get Challenge' command */ template CommandGetChallenge mw_getChallenge := { class := mw_class_00, ins := e_getChallenge, Loading @@ -237,6 +280,9 @@ module ePassport_Templates { lengthE := ? } /** * @desc Receive template for 'External Authenticate' command */ template CommandExternalOrMutualAuthenticate mw_extAuthenticate := { class := mw_class_00, ins := e_externalOrMutualAuthenticate, Loading @@ -249,6 +295,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Internal Authenticate' command */ template CommandInternalAuthenticate mw_intAuthenticate := { class := mw_class_00, ins := e_internalAuthenticate, Loading @@ -261,6 +310,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Set Digital Signature Template' command */ template CommandManageSecurityEnvironment mw_mseSetDST := { class := mw_class_00, ins := e_manageSecurityEnvironment, Loading Loading @@ -290,6 +342,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Generic receive template for 'Set Key Authentication Template' command */ template CommandManageSecurityEnvironment mw_mseSetKAT := { class := mw_class_00, ins := e_manageSecurityEnvironment, Loading Loading @@ -326,18 +381,12 @@ module ePassport_Templates { lengthE := * } template CommandManageSecurityEnvironment mw_mseSetKAT_chipAuthentication := { class := mw_class_00, ins := e_manageSecurityEnvironment, params := { mseSecureMessagingInCommandDataField := ?, mseSecureMessagingInResponseDataField := ?, mseComputationDeciphermentIntAuthKeyAgreement := ?, mseVerificationEnciphermentExtAuthKeyAgreement := ?, mseFunction := e_mseFunctionSet, crtTag := e_crtKAT }, lengthC := ?, /** * @desc Receive template for 'Set Key Authentication Template' command as used in Chip Authentication * @see mw_mseSetKAT */ template CommandManageSecurityEnvironment mw_mseSetKAT_chipAuthentication modifies mw_mseSetKAT := { payload := { manageSecurityEnvironmentData := { crtKAT := { Loading @@ -358,10 +407,12 @@ module ePassport_Templates { crtUsageQualifierByte := omit } } }, lengthE := * } } /** * @desc Receive template for 'Set Authentication Template' command */ template CommandManageSecurityEnvironment mw_mseSetAT := { class := mw_class_00, ins := e_manageSecurityEnvironment, Loading Loading @@ -391,6 +442,9 @@ module ePassport_Templates { lengthE := * } /** * @desc Receive template for 'Verify Certificate' command */ template CommandPerformSecurityOperation mw_psoVerifyCertificate := { class := mw_class_00, ins := e_performSecurityOperation, Loading @@ -415,25 +469,38 @@ module ePassport_Templates { group responseTemplates { // Response OK /** * @desc Send template for response indicating Success */ template (value) Response m_responseOK := { responseData := omit, w1w2 := c_w1w2NormalProcessing } // Response NOK /** * @desc Send template for response indicating failure or warning * @param v_w1w2 Status code of the failure/warning */ template (value) Response m_responseNOK(W1W2Status v_w1w2) := { responseData := omit, w1w2 := v_w1w2 } // Response Data Template /** * @desc Send template for response to Read commands * @param v_data Read data */ template (value) Response m_responseRead(template (omit) PlainTextResponseData v_data) := { responseData := {plainText := v_data}, w1w2 := c_w1w2NormalProcessing } // Response Data Template /** * @desc end template for response to Read commands with specific status code * @param p_data Read data * @param p_w1w2 Error code of the failure/warning */ template (value) Response m_responseReadWithStatus(template (omit) PlainTextResponseData p_data, W1W2Status p_w1w2) := { responseData := {plainText := p_data}, w1w2 := p_w1w2 Loading