6.2.7 Class ProactiveHandler

3GPP51.013Release 17Test specification for Subscriber Identity Module (SIM) Application Programming Interface (API) for Java CardTS

6.2.7.1 Method getTheHandler

Test Area Reference: API_2_PAH_GTHD

6.2.7.1.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public static ProactiveHandler getTheHandler()

throws ToolkitException

6.2.7.1.1.1 Normal execution

  • CRRN1: The method shall return the single system instance of the ProactiveHandler class.
  • CRRN2: The EnvelopeHandler is a Temporary JCRE Entry Point Object

6.2.7.1.1.2 Parameter errors

No requirements.

6.2.7.1.1.3 Context errors

  • CRRC1: The method shall throw ToolkitException.HANDLER_NOT_AVAILABLE if the handler is busy.

6.2.7.1.2 Test Suite files

Test Script: API_2_PAH_GTHD_1.scr

Test Applet: API_2_PAH_GTHD_1.java

Load Script: API_2_PAH_GTHD_1.ldr

Cleanup Script: API_2_PAH_GTHD_1.clr

Parameter File: API_2_PAH_GTHD_1.par

6.2.7.1.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

getTheHandler() twice

The returned objects shall be the same

2

getTheHandler()

The reference shall be a ProactiveHandler

3

getTheHandler()

The reference shall not be null

6.2.7.1.4 Test Coverage

CRR number

Test case number

N1

1, 2, 3

N2

Checked in Framework tests: FWK_API_HEPO (test case 3)

C1

Checked in Framework tests: FWK_MHA_PAHD

6.2.7.2 Method init

Test Area Reference: API_2_PAH_INITBBB

6.2.7.2.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public void init(byte type,

byte qualifier,

byte dstDevice)

6.2.7.2.1.1 Normal execution

  • CRRN1: The init() method initialises the next Proactive command in the ProactiveHandler, with Command details and Device Identities TLV. The source device is always the SIM Card (81h). The Comprehension Required flags are set.
  • CRRN2: The Command number may take any value between 01h and FEh.
  • CRRN3: The init() method clears the ProactiveHandler before initializing it.
  • CRRN4: No TLV is selected after a call to the method.
  • CRRN5: The handler is not sent to the mobile by the init() method.

6.2.7.2.1.2 Parameter errors

No requirements.

6.2.7.2.1.3 Context errors

No requirements.

6.2.7.2.2 Test Suite files

Test Script: API_2_PAH_INITBBB_1.scr

Test Applet: API_2_PAH_INITBBB_1.java

Load Script: API_2_PAH_INITBBB_1.ldr

Cleanup Script: API_2_PAH_INITBBB_1.clr

Parameter File: API_2_PAH_INITBBB_1.par

6.2.7.2.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Call the init() method

type = 01h

qualifier = 02h

dstDevice = 03h

Copy ProactiveHandler in a byte array (source)

Compare the byte array

reference =

81h 03h xxh 01h 02h

82h 02h 81h 03h

source and reference are identical

2

Verify the command number value

01h-FEh

3

Call the init() method

type = FFh

qualifier = FEh

destination = FDh

Copy ProactiveHandler in a byte array (source)

Compare the byte array

reference =

81h 03h xxh FFh FEh

82h 02h 81h FDh

source and reference are identical

4

Select the 1st TLV in the handler

Call the init() method with any value

Call the getValueLength() method

UNAVAILABLE_ELEMENT ToolkitException is thrown by getValueLength()

6.2.7.2.4 Test Coverage

CRR number

Test case number

N1

1, 3

N2

2

N3

3

N4

4

N5

1, 3

6.2.7.3 Method initDisplayText

Test Area Reference: API_2_PAH_INDTBB_BSS

6.2.7.3.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public void initDisplayText(byte qualifier,

byte dcs,

byte[] buffer,

short offset,

short length)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.3.1.1 Normal execution

  • CRRN1: The method shall build a DISPLAY TEXT proactive command in the ProactiveHandler, using qualifier, dcs and buffer parameters. Comprehension required flags are set.
  • CRRN2: A call to this method clears the handler then initialises it.
  • CRRN3: No TLV is selected after a call to the method.
  • CRRN4: The DISPLAY TEXT command is not sent by the method.
  • CRRN5: The Command Number may take any value between 01h and FEh.
  • CRRN6: If length is equal to zero, then the Text String TLV inserted in the command is a null text string TLV as defined in TS 11.14 [4].

6.2.7.3.1.2 Parameter errors

  • CRRP1: The method shall throw NullPointerException if buffer is null.
  • CRRP2: If offset or length or both would cause access outside array bounds, an ArrayIndexOutOfBoundsException shall be thrown.

6.2.7.3.1.3 Context errors

  • CRRC1: A ToolkitException.HANDLER_OVERFLOW shall be thrown if the ProactiveHandler is too small to put the requested data.

6.2.7.3.2 Test Suite files

Test Script: API_2_PAH_INDTBB_BSS_1.scr

Test Applet: API_2_PAH_INDTBB_BSS_1.java

Load Script: API_2_PAH_INDTBB_BSS_1.ldr

Cleanup Script: API_2_PAH_INDTBB_BSS_1.clr

Parameter File: API_2_PAH_INDTBB_BSS_1.par

6.2.7.3.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

NULL as parameter to buffer

buffer = NULL

NullPointerException is thrown

2

offset > buffer.length

buffer = "Text"

offset = 5

length = 0

ArrayIndexOutOfBoundsException is thrown

3

offset < 0

buffer = "Text"

offset = -1

ArrayIndexOutOfBoundsException is thrown

4

length > buffer.length

buffer = "Text"

offset = 0

length = 5

ArrayIndexOutOfBoundsException is thrown

5

offset + length > buffer.length

buffer = "Text"

offset = 3

length = 2

ArrayIndexOutOfBoundsException is thrown

6

length < 0

buffer = "Text"

offset = 3

length = -1

ArrayIndexOutOfBoundsException is thrown

7

Successful call, buffer is the whole buffer

qualifier = 0

dcs = 4

buffer = "TextA"

offset = 0

length = 5

No exception is thrown

Verify the command number value

Command number between 01h and FEh

8

Send the command

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 4

Text = "TextA"

9

Successful call, buffer is part of a buffer with the end part

Send the command

qualifier = 0

dcs = 4

buffer = "12TextB"

offset = 2

length = 5

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 4

Text = "TextB"

10

Successful call, buffer is part of a buffer with the first part

Send the command

qualifier = 0

dcs = 4

buffer = "TextC12"

offset = 0

length = 5

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 4

Text = "TextC"

11

Successful call, buffer is part of a buffer

Send the command

qualifier = 0

dcs = 4

buffer = "12TextD34"

offset = 2

length = 5

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 4

Text = "TextD"

12

Successful call, qualifier = 81h

Send the command

qualifier = 81h

dcs = 4

buffer = "TextE"

offset = 0

length = 5

DISPLAY TEXT Proactive command

qualifier = 81h

dcs = 4

Text = "TextE"

13

Successful call, DCS=0 (7 bits)

Send the command

qualifier = 0

dcs = 0

buffer = "TextF"

offset = 0

length = 5

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 0

Text = "TextF"

14

Successful call, DCS=8 (UCS2)

Send the command

qualifier = 0

dcs = 8

buffer = "TextG"

offset = 0

length = 5

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 8

Text = "TextG"

15

Call the initDisplayText() method with any value

Then build and send a DISPLAY TEXT command

qualifier = 0

dcs = 4

buffer = "TextHTextH"

offset = 0

length = 10

DISPLAY TEXT Proactive command

qualifier = 00h

dcs = 4

Text = "TextHTextH"

16

Successful call, text length is zero

Send the command

qualifier = 0

dcs = 4

buffer = "TextHTextH"

offset = 0

length = 0

DISPLAY TEXT Proactive command

qualifier = 00h

Text String TLV = 8D 00

17

Select a TLV in the ProactiveHandler

Call the initDisplayText() method

Call the getValueLength() method

UNAVAILABLE_ELEMENT ToolkitException is thrown by getValueLength()

18

Successful call, buffer length = 7Eh

qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 7Eh

DISPLAY TEXT Proactive command

Text String TLV =

8D 7F 04 55 55…

19

Successful call, buffer length = 7Fh

qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 7Fh

DISPLAY TEXT Proactive command

Text String TLV = 8D 81 80 04 55 55…

20

Successful call, buffer length = 240

Qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 240

DISPLAY TEXT Proactive command

Text String TLV =

8D 81 F1 04 55 55…

21

Call the initDisplayText() method with a too long buffer

qualifier = 0

dcs = 4

buffer = "XXXX…"

offset = 0

length = 241

HANDLER_OVERFLOW ToolkitException is thrown

22

Call the initDisplayText() without sending the command

No proactive command shall be sent expected status is ‘9000’

6.2.7.3.4 Test Coverage

CRR number

Test case number

N1

8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20

N2

15

N3

17

N4

22

N5

7

N6

16

P1

1

P2

2, 3, 4, 5, 6

C1

21

6.2.7.4 Method initGetInkey

Test Area Reference: API_2_PAH_INGKBB_BSS

6.2.7.4.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public void initGetInkey(byte qualifier,

byte dcs,

byte[] buffer,

short offset,

short length)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.4.1.1 Normal execution

  • CRRN1: The method shall build a GET INKEY proactive command in the ProactiveHandler, using qualifier, dcs and buffer parameters. Comprehension Required flags are set.
  • CRRN2: A call to this method clears the handler then initialises it.
  • CRRN3: No TLV is selected after a call to the method.
  • CRRN4: The GET INKEY command is not sent by the method.
  • CRRN5: The Command Number may take any value between 01h and FEh.
  • CRRN6: If length is equal to zero, then the Text String TLV inserted in the command is a null text string TLV as defined in TS 11.14 [4].

6.2.7.4.1.2 Parameter errors

  • CRRP1: The method shall throw NullPointerException if buffer is null.
  • CRRP1: If offset or length or both would cause access outside array bounds, a ArrayIndexOutOfBoundsException shall be thrown.

6.2.7.4.1.3 Context errors

  • CRRC1: A ToolkitException.HANDLER_OVERFLOW shall be thrown if the ProactiveHandler is to small to put the requested data.

6.2.7.4.2 Test Suite files

Test Script: API_2_PAH_INGKBB_BSS_1.scr

Test Applet: API_2_PAH_INGKBB_BSS_1.java

Load Script: API_2_PAH_INGKBB_BSS_1.ldr

Cleanup Script: API_2_PAH_INGKBB_BSS_1.clr

Parameter File: API_2_PAH_INGKBB_BSS_1.par

6.2.7.4.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

NULL as parameter to buffer

buffer = NULL

NullPointerException is thrown

2

offset > buffer.length

buffer = "Text"

offset = 5

ArrayIndexOutOfBoundsException is thrown

3

offset < 0

buffer = "Text"

offset = -1

ArrayIndexOutOfBoundsException is thrown

4

length > buffer.length

buffer = "Text"

offset = 0

length = 5

ArrayIndexOutOfBoundsException is thrown

5

offset + length > buffer.length

buffer = "Text"

offset = 3

length = 2

ArrayIndexOutOfBoundsException is thrown

6

length < 0

buffer = "Text"

offset = 3

length = -1

ArrayIndexOutOfBoundsException is thrown

7

Successful call, buffer is the whole buffer

qualifier = 0

dcs = 4

buffer = "TextA"

offset = 0

length = 5

No exception is thrown

Verify the command number value

Command number between 01h and FEh

8

Send the command

GET INKEY Proactive command

qualifier = 00h

dcs = 4

Text = "TextA"

9

Successful call, buffer is part of a buffer with the end part

qualifier = 0

dcs = 4

buffer = "12TextB"

offset = 2

length = 5

GET INKEY Proactive command

qualifier = 00h

dcs = 4

Text = "TextB"

10

Successful call, buffer is part of a buffer with the first part

qualifier = 0

dcs = 4

buffer = "TextC12"

offset = 0

length = 5

GET INKEY Proactive command

qualifier = 00h

dcs = 4

Text = "TextC"

11

Successful call, buffer is part of a buffer

Send the command

qualifier = 0

dcs = 4

buffer = "12TextD34"

offset = 2

length = 5

GET INKEY Proactive command

qualifier = 00h

dcs = 4

Text = "TextD"

12

Successful call, qualifier = 81h

qualifier = 81h

dcs = 4

buffer = "TextE"

offset = 0

length = 5

GET INKEY Proactive command

qualifier = 81h

dcs = 4

Text = "TextE"

13

Successful call, DCS=0 (7 bits)

qualifier = 0

dcs = 0

buffer = "TextF"

offset = 0

length = 5

GET INKEY Proactive command

qualifier = 00h

dcs = 0

Text = "TextF"

14

Successful call, DCS=8 (UCS2)

qualifier = 0

dcs = 8

buffer = "TextG"

offset = 0

length = 5

GET INKEY Proactive command

qualifier = 00h

dcs = 8

Text = "TextG"

15

Call the initGetInkey() method with any value

Then build and send a GET INKEY command

qualifier = 0

dcs = 4

buffer = "TextHTextH"

offset = 0

length = 10

GET INKEY Proactive command

qualifier = 00h

dcs = 4

Text = "TextHTextH"

16

Successful call, text length is zero

Send the command

qualifier = 0

dcs = 4

buffer = "TextHTextH"

offset = 0

length = 0

GET INKEY Proactive command

qualifier = 00h

Text String TLV = 8D 00

17

Select a TLV in the ProactiveHandler

Call the initGetInkey() method

Call the getValueLength() method

UNAVAILABLE_ELEMENT ToolkitException is thrown by getValueLength()

18

Successful call, buffer length = 7Eh

qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 7Eh

GET INKEY Proactive command

Text String TLV =

8D 7F 04 55 55…

19

Successful call, buffer length = 7Fh

qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 7Fh

GET INKEY Proactive command

Text String TLV = 8D 81 80 04 55 55…

20

Successful call, buffer length = 240

Qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 240

GET INKEY Proactive command

Text String TLV =

8D 81 F1 04 55 55…

21

Call the initGetInkey() method with a too long buffer

qualifier = 0

dcs = 4

buffer = "XXXX…"

offset = 0

length = 241

HANDLER_OVERFLOW ToolkitException is thrown

22

Call the initGetInkey() without sending the command

No proactive command shall be sent expected status is ‘9000’

6.2.7.4.4 Test Coverage

CRR number

Test case number

N1

8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20

N2

15

N3

17

N4

22

N5

7

N6

16

P1

1

P2

2, 3, 4, 5, 6

C1

21

6.2.7.5 Method initGetInput

Test Area Reference: API_2_PAH_INGPBB_BSSSS

6.2.7.5.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public void initGetInput(byte qualifier,

byte dcs,

byte[] buffer,

short offset,

short length,

short minRespLength,

short maxRespLength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.5.1.1 Normal execution

  • CRRN1: The method shall build a GET INPUT proactive command in the ProactiveHandler, using qualifier, dcs, buffer, minRespLength and maxRespLength parameters. Comprehension Required flags are set.
  • CRRN2: A call to this method clears the handler then initialises it.
  • CRRN3: No TLV is selected after a call to the method.
  • CRRN4: The GET INPUT command is not sent by the method.
  • CRRN5: The Command Number may take any value between 01h and FEh.
  • CRRN6: If length is equal to zero, then the Text String TLV inserted in the command is a null text string TLV as defined in TS 11.14 [4].

6.2.7.5.1.2 Parameter errors

  • CRRP1: The method shall throw NullPointerException if buffer is null.
  • CRRP2: If offset or length or both would cause access outside array bounds, a ArrayIndexOutOfBoundsException shall be thrown.

6.2.7.5.1.3 Context errors

  • CRRC1: A ToolkitException.HANDLER_OVERFLOW shall be thrown if the ProactiveHandler is to small to put the requested data.

6.2.7.5.2 Test Suite files

Test Script: API_2_PAH_INGPBB_BSSSS_1.scr

Test Applet: API_2_PAH_INGPBB_BSSSS_1.java

Load Script: API_2_PAH_INGPBB_BSSSS_1.ldr

Cleanup Script: API_2_PAH_INGPBB_BSSSS_1.clr

Parameter File: API_2_PAH_INGPBB_BSSSS_1.par

6.2.7.5.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

NULL as parameter to buffer

buffer = NULL

NullPointerException is thrown

2

offset > buffer.length

buffer = "Text"

offset = 5

ArrayIndexOutOfBoundsException is thrown

3

offset < 0

buffer = "Text"

offset = -1

ArrayIndexOutOfBoundsException is thrown

4

length > buffer.length

buffer = "Text"

offset = 0

length = 5

ArrayIndexOutOfBoundsException is thrown

5

offset + length > buffer.length

buffer = "Text"

offset = 3

length = 2

ArrayIndexOutOfBoundsException is thrown

6

length < 0

buffer = "Text"

offset = 3

length = -1

ArrayIndexOutOfBoundsException is thrown

7

Successful call, buffer is the whole buffer

qualifier = 0

dcs = 4

buffer = "TextA"

offset = 0

length = 5

minRespLength = 00h

maxRespLength = FFh

No exception is thrown

Verify the command number value

Command number between 01h and FEh

8

Send the command

GET INPUT Proactive command

qualifier = 00h

dcs = 4

Text = "TextA"

Min Length = 00h

Max Length = FFh

9

Successful call, buffer is part of a buffer with the end part

Send the command

qualifier = 0

dcs = 4

buffer = "12TextB"

offset = 2

length = 5

minRespLength = 10h

maxRespLength = FFh

GET INPUT Proactive command

qualifier = 00h

dcs = 4

Text = "TextB"

Min Length = 10h

Max Length = FFh

10

Successful call, buffer is part of a buffer with the first part

Send the command

qualifier = 0

dcs = 4

buffer = "TextC12"

offset = 0

length = 5

minRespLength = FFh

maxRespLength = FFh

GET INPUT Proactive command

qualifier = 00h

dcs = 4

Text = "TextC"

Min Length = FFh

Max Length = FFh

11

Successful call, buffer is part of a buffer

Send the command

qualifier = 0

dcs = 4

buffer = "12TextD34"

offset = 2

length = 5

minRespLength = 00h

maxRespLength = 00h

GET INPUT Proactive command

qualifier = 00h

dcs = 4

Text = "TextD"

Min Length = 00h

Max Length = 00h

12

Successful call, qualifier = 81h

qualifier = 81h

dcs = 4

buffer = "TextE"

offset = 0

length = 5

minRespLength = 00h

maxRespLength = 10h

GET INPUT Proactive command

qualifier = 81h

dcs = 4

Text = "TextE"

Min Length = 00h

Max Length = 10h

13

Successful call, DCS=0 (7 bits)

qualifier = 0

dcs = 0

buffer = "TextF"

offset = 0

length = 5

minRespLength = 10h

maxRespLength = 10h

GET INPUT Proactive command

qualifier = 00h

dcs = 0

Text = "TextF"

Min Length = 10h

Max Length = 10h

14

Successful call, DCS=8 (UCS2)

qualifier = 0

dcs = 8

buffer = "TextG"

offset = 0

length = 5

minRespLength = 00h

maxRespLength = FFh

GET INPUT Proactive command

qualifier = 00h

dcs = 8

Text = "TextG"

Min Length = 00h

Max Length = FFh

15

Call the initGetInput() method with any value

Then build and send a GET INPUT command

qualifier = 0

dcs = 4

buffer = "TextHTextH"

offset = 0

length = 10

minRespLength = 00h

maxRespLength = 10h

GET INPUT Proactive command

qualifier = 00h

dcs = 4

Text = "TextHTextH"

Min Length = 00h

Max Length = 10h

16

Successful call, text length is zero

Send the command

qualifier = 0

dcs = 4

buffer = "TextHTextH"

offset = 0

length = 0

minRespLength = 00h

maxRespLength = 10h

GET INPUT Proactive command

qualifier = 00h

Text String TLV = 8D 00

Min Length = 00h

Max Length = 10h

17

Select a TLV in the ProactiveHandler

Call the initGetInput() method

Call the getValueLength() method

UNAVAILABLE_ELEMENT ToolkitException is thrown by getValueLength()

18

Successful call, buffer length = 7Eh

qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 7Eh

minRespLength = 00h

maxRespLength = 10h

GET INPUT Proactive command

Text String TLV =

8D 7F 04 55 55…

Min Length = 00h

Max Length = 10h

19

Successful call, buffer length = 7Fh

qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 7Fh

minRespLength = 00h

maxRespLength = 10h

GET INPUT Proactive command

Text String TLV = 8D 81 80 04 55 55…

Min Length = 00h

Max Length = 10h

20

Successful call, buffer length = 236

Qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 236

minRespLength = 00h

maxRespLength = 10h

GET INPUT Proactive command

Text String TLV =

8D 81 ED 04 55 55…

21

Call the initGetInput() method with a too long buffer

qualifier = 0

dcs = 4

buffer = "XXXX…"

offset = 0

length = 237

minRespLength = 00h

maxRespLength = 10h

HANDLER_OVERFLOW ToolkitException is thrown

22

Call the initGetInput() without sending the command

No proactive command shall be sent expected status is ‘9000’

6.2.7.5.4 Test Coverage

CRR number

Test case number

N1

8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20

N2

15

N3

17

N4

22

N5

7

N6

16

P1

1

P2

2, 3, 4, 5, 6

C1

21

6.2.7.6 Method send

Test Area Reference: API_2_PAH_SEND

6.2.7.6.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public byte send()

6.2.7.6.1.1 Normal execution

  • CRRN1: The send() method send the current proactive command to the mobile.
  • CRRN2: The returned byte is equal to general result of the command (first byte of Result TLV in Terminal Response).
  • CRRN3: The handler remains unchanged after a call to send() method until the use of initXX() or appendTLV().
  • CRRN4: There is no invocation of select() or deselect() method.
  • CRRN5: A pending toolkit applet transaction at the method invocation is aborted.

6.2.7.6.1.2 Parameter errors

No requirements.

6.2.7.6.1.3 Context errors

  • CRRC1: A ToolkitException.UNAVAILABLE_ELEMENT shall be thrown is the Result Simple TLV is missing in Terminal Response.
  • CRRC2: A ToolkitException.OUT_OF_TLV_BOUNDARIES shall be thrown if the general result byte is missing in the Result Simple TLV in Terminal Response.
  • CRRC3: A ToolkitException COMMAND_NOT_ALLOWED shall be thrown if the proactive command to be sent is not allowed by the SIM Toolkit Framework.
  • CRRC4: A ToolkitException COMMAND_NOT_ALLOWED shall be thrown if one parameter of the proactive command to be sent is not allowed by the SIM Toolkit Framework.

6.2.7.6.2 Test Suite files

Test Script: API_2_PAH_SEND_1.scr

Test Applet: API_2_PAH_SEND_1.java

Load Script: API_2_PAH_SEND_1.ldr

Cleanup Script: API_2_PAH_SEND_1.clr

Parameter File: API_2_PAH_SEND_1.par

6.2.7.6.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Build and send a DISPLAY TEXT command

qualifier = 00h

dcs = 04h

buffer = ‘Text’

DISPLAY TEXT Proactive command

2

Terminal Response with General Result = 00

Result TLV = 03 01 00 (command performed successfully)

Result of send() is 00h

3

Build and send a DISPLAY TEXT command

qualifier = 00h

dcs = 04h

buffer = ‘Text’

DISPLAY TEXT Proactive command

4

Terminal Response with General Result = 01, without Additional information on result

Result TLV = 03 01 01 (command performed with partial comprehension)

Result of send() is 01h

5

Build and send a DISPLAY TEXT command

qualifier = 00h

dcs = 04h

buffer = ‘Text’

DISPLAY TEXT Proactive command

6

Terminal Response with General Result = 01, with Additional information on result

Result TLV = 03 02 01 55 (command performed with partial comprehension)

Result of send() is 01h

7

Build and send a DISPLAY TEXT command

qualifier = 00h

dcs = 04h

buffer = ‘Text’

DISPLAY TEXT Proactive command

8

Terminal Response with General Result = 02

Result TLV = 03 04 02 65 43 21 (Missing information)

Result of send() is 02h

9

Build and send a 7Fh byte command (DISPLAY TEXT)

qualifier = 00h

dcs = 04h

buffer = "UUUUU…"

length = 73h

DISPLAY TEXT Proactive command

BER-TLV = D0 7F

Text String TLV = 8D 74 04 55 55 55…

10

Build and send a 80h byte command (DISPLAY TEXT)

qualifier = 00h

dcs = 04h

buffer = "UUUUU…"

length = 74h

DISPLAY TEXT Proactive command

BER-TLV = D0 81 80

Text String TLV = 8D 75 04 55 55 55…

11

Build and send a maximum length command (length of the handler should be 253)

DISPLAY TEXT:

Qualifier = 0

dcs = 4

buffer = "UUU…"

offset = 0

length = 240

DISPLAY TEXT Proactive command

BER-TLV = D0 81 FD

Text String TLV = 8D 81 F1 04 55 55…

12

Verify that the Proactive Handler is not modified after a send()

Build a DISPLAY TEXT command

Copy ProactiveHandler to source byte array

Send command

Copy ProactiveHandler to destination byte array

Compare source and destination

Source and destination are identical

13

Build and send a DISPLAY TEXT command

Verify there is no invocation of select() or deselect() method.

DISPLAY TEXT Proactive command

14

Build and send a DISPLAY TEXT command

DISPLAY TEXT Proactive command

Terminal Response with 2 Result TLV

1st Result TLV = 03 02 02 12

2nd Result TLV = 03 03 03 34 56

Result of send() is 02h

15

Build and send a DISPLAY TEXT command

DISPLAY TEXT Proactive command

Terminal Response without Result Simple TLV

ToolkitException.UNAVAILABLE_ELEMENT is thrown by send()

16

Build and send a DISPLAY TEXT command

DISPLAY TEXT Proactive command

Terminal Response without general result byte in the Simple TLV

Result TLV = 03 00

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown by send()

6.2.7.6.4 Test Coverage

CRR number

Test case number

N1

1, 3, 5, 7, 9, 10, 11, 12, 13, 14

N2

2, 4, 6, 8, 14

N3

12

N4

13

N5

checked in Framework tests: FWK_API_TRAN

C1

15

C2

16

C3

checked in the Framework test : FWK_PCS_PCCO (test case 1)

C4

checked in the Framework test : FWK_PCS_PCCO (test cases 2 to 3)

6.2.7.7 Method getLength

Test Area Reference API_2_PAH_GLEN

6.2.7.7.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public short getLength()

throws ToolkitException

6.2.7.7.1.1 Normal execution

  • CRRN1: returns the length in bytes of the TLV list.

6.2.7.7.1.2 Parameter errors

No requirements.

6.2.7.7.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException.HANDLER_NOT_AVAILABLE.

6.2.7.7.2 Test Suite files

Test Script: API_2_PAH_GLEN_1.scr

Test Applet: API_2_PAH_GLEN_1.java

Load Script: API_2_PAH_GLEN_1.ldr

Cleanup Script: API_2_PAH_GLEN_1.clr

Parameter File: API_2_PAH_GLEN_1.par

6.2.7.7.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Clear the handler

getLength()

Result of getLength() is 0

2

Call the init() method

getLength()

Result of getLength() is 9

3

Call the initDisplayText() method, with buffer length = 240

getLength()

Result of getLength() is 253

4

Build a 7Fh Proactive Handler

getLength()

Result of getLength() is 7Fh

5

Build a 80h Proactive Handler

getLength()

Result of getLength() is 80h

6.2.7.7.4 Test Coverage

CRR number

Test case number

N1

1, 2, 3, 4, 5

C1

Does not apply for Proactive Handler

6.2.7.8 Method copy

Test Area Reference API_2_PAH_COPY_BSS

6.2.7.8.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public short copy(byte[] dstBuffer,

short dstOffset,

short dstLength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.8.1.1 Normal execution

  • CRRN1: copies the simple TLV list contained in the handler to the destination byte array.
  • CRRN2: returns dstOffset + dstLength.

6.2.7.8.1.2 Parameter errors

  • CRRP1: if dstBuffer is null a NullPointerException is thrown.
  • CRRP2: if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative, an ArrayIndexOutOfBoundsException is thrown.
  • CRRP3: if dstLength is grater than the length of the simple TLV List, an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException. OUT_OF_TLV_BOUNDARIES.

6.2.7.8.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.

6.2.7.8.2 Test Suite files

Test Script: API_2_PAH_COPY_BSS_1.scr

Test Applet: API_2_PAH_COPY_BSS_1.java

Load Script: API_2_PAH_COPY_BSS_1.ldr

Cleanup Script: API_2_PAH_COPY_BSS_1.clr

Parameter File: API_2_PAH_COPY_BSS_1.par

6.2.7.8.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

NULL as parameter to dstBuffer

NullPointerException is thrown

2

Call the init() method

DstOffset > dstBuffer.length

dstBuffer.length = 5

dstOffset = 6

dstLength = 0

ArrayIndexOutOfBoundsException is thrown

3

dstOffset < 0

dstBuffer.length = 5

dstOffset = -1

dstLength = 1

ArrayIndexOutOfBoundsException is thrown

4

DstLength > dstBuffer.length

dstBuffer.length = 5

dstOffset = 0

dstLength = 6

ArrayIndexOutOfBoundsException is thrown

5

dstOffset + dstLength > dstBuffer.length

dstBuffer.length = 5

dstOffset = 3

dstLength = 3

ArrayIndexOutOfBoundsException is thrown

6

dstLength < 0

dstBuffer.length = 5

dstOffset = 0

dstLength = -1

ArrayIndexOutOfBoundsException is thrown

7

dstLength > length of the simple TLV list

dstBuffer.length = 10

dstOffset = 0

dstLength = 10

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

8

Successful call, dstBuffer is the whole buffer

dstBuffer.length = 9

dstOffset = 0

dstLength = 9

Result of copy() is 9

9

Compare the buffer

Result of arrayCompare() is 0

10

Successful call, dstBuffer is part of a buffer

dstBuffer.length = 15

dstOffset = 3

dstLength = 9

Result of copy() is 12

11

Compare the whole buffer

Result of arrayCompare() is 0

12

Successful call, dstBuffer is part of a buffer

dstBuffer.length = 15

dstOffset = 3

dstLength = 6

Result of copy() is 9

13

Compare the whole buffer

Result of arrayCompare() is 0

6.2.7.8.4 Test Coverage

CRR number

Test case number

N1

9, 11, 13

N2

8, 10, 12

P1

1

P2

2, 3, 4, 5, 6

P3

7

C1

Does not apply for ProactiveHandler

6.2.7.9 Method findTLV

Test Area Reference API_2_PAH_FINDBB

6.2.7.9.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public byte findTLV(byte tag, byte occurrence)

throws ToolkitException

6.2.7.9.1.1 Normal execution

Looks for the indicated occurrence of a TLV element from the beginning of the TLV list (handler buffer):

  • CRRN1: the method is successful if the required occurrence exists then the corresponding TLV becomes current.
  • CRRN2: if the method is successful then it returns TLV_FOUND_CR_SET when Comprehension Required flag is set.
  • CRRN3: if the method is successful then it returns TLV_FOUND_CR_NOT_SET when Comprehension Required flag is not set.
  • CRRN4: if the required occurrence of the TLV element does not exist, the current TLV is no longer defined and TLV_NOT_FOUND is returned.
  • CRRN5: The search method is comprehension required flag independent.

6.2.7.9.1.2 Parameter errors

  • CRRP1: if an input parameter is not valid (e.g. occurrence = 0) an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException BAD_INPUT_PARAMETER.

6.2.7.9.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.

6.2.7.9.2 Test Suite files

Test Script: API_2_PAH_FINDBB_1.scr

Test Applet: API_2_PAH_FINDBB_1.java

Load Script: API_2_PAH_FINDBB_1.ldr

Cleanup Script: API_2_PAH_FINDBB_1.clr

Parameter File: API_2_PAH_FINDBB_1.par

6.2.7.9.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

Invalid input parameter

Occurrence = 0

ToolkitException.BAD_INPUT_PARAMETER is thrown

2

Call the init() method

Search 1st TLV

Tag = 01h

Occurrence = 1

Result is TLV_FOUND_CR_SET

3

Call the getValueLength() method

Result is 03h

4

Search 2nd TLV

Tag = 02h

Occurrence = 1

Result is TLV_FOUND_CR_SET

5

Call the getValueLength() method

Result is 02h

6

Select a TLV (tag 02h)

Search a wrong tag

Tag = 03h

Occurrence = 1

Result is TLV_NOT_FOUND

7

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown.

8

Search a tag with wrong occurrence

Tag = 01h

Occurrence = 2

Result is TLV_NOT_FOUND

9

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown.

10

Append a TLV with tag=02h

Search the TLV

Tag = 02h

Occurrence = 2

Result is TLV_FOUND_CR_NOT_SET

11

Append a TLV with tag=04h

Search the TLV

Tag = 04h

Occurrence = 1

Result is TLV_FOUND_CR_NOT_SET

12

Search tag 81h

Tag = 81h

Occurrence = 1

Result is TLV_FOUND_CR_SET

13

Search tag 84h

Tag = 84h

Occurrence = 1

Result is TLV_FOUND_CR_NOT_SET

6.2.7.9.4 Test Coverage

CRR number

Test case number

N1

3, 5

N2

2, 4

N3

10, 11

N4

6, 7,8, 9

N5

12, 13

P1

1

C1

Does not apply for Proactive Handler

6.2.7.10 Method getValueLength

Test Area Reference API_2_PAH_GVLE

6.2.7.10.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public short getValueLength()

throws ToolkitException

6.2.7.10.1.1 Normal execution

  • CRRN1: gets and returns the binary length of the value field for the last TLV element which has been found in the handler.

6.2.7.10.1.2 Parameter errors

No requirements.

6.2.7.10.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
  • CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.

6.2.7.10.2 Test Suite files

Test Script: API_2_PAH_GVLE_1.scr

Test Applet: API_2_PAH_GVLE_1.java

Load Script: API_2_PAH_GVLE_1.ldr

Cleanup Script: API_2_PAH_GVLE_1.clr

Parameter File: API_2_PAH_GVLE_1.par

6.2.7.10.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Call the init() method

getValueLength()

ToolkitException.UNAVAILABLE_ELEMENT is thrown

2

Call the appendTLV() method

tag = 0D

valueOffset = 0

valueLength = 0

Search TLV 0Dh (Text String TLV)

getValueLength()

Result is 00h

3

Call the initDisplayText() method

length = 1 (+ dcs byte)

Search TLV 0Dh (Text String TLV)

getValueLength()

Result is 02h

4

Call the initDisplayText() method

length = 7Eh (+ dcs byte)

Search TLV 0Dh (Text String TLV)

getValueLength()

Result is 7Fh

5

Call the initDisplayText() method

length = 7Fh (+ dcs byte)

Search TLV 0Dh (Text String TLV)

getValueLength()

Result is 80h

6

Call the initDisplayText() method

length = F0h (maximum text length)

Search TLV 0Dh (Text String TLV)

getValueLength()

Result is F1h

6.2.7.10.4 Test Coverage

CRR number

Test case number

N1

2, 3, 4, 5, 6

C1

Does not apply for Proactive Handler

C2

1

6.2.7.11 Method getValueByte

Test Area Reference API_2_PAH_GVBYS

6.2.7.11.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public byte getValueByte(short valueOffset)

throws ToolkitException

6.2.7.11.1.1 Normal execution

  • CRRN1: Gets a byte from the last TLV element which has been found in the handler and returns its value (1 byte).

6.2.7.11.1.2 Parameter errors

  • CRRP1: if valueOffset is out of the current TLV an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.

6.2.7.11.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
  • CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.

6.2.7.11.2 Test Suite files

Test Script: API_2_PAH_GVBYS_1.scr

Test Applet: API_2_PAH_GVBYS_1.java

Load Script: API_2_PAH_GVBYS_1.ldr

Cleanup Script: API_2_PAH_GVBYS_1.clr

Parameter File: API_2_PAH_GVBYS_1.par

6.2.7.11.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Call the init() method

type = FFh

qualifier = FEh

destination = FDh

getValueByte(0)

ToolkitException.UNAVAILABLE_ELEMENT is thrown

2

Search TLV 01h (Command Details TLV)

getValueByte(3)

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

3

Search TLV 01h (Command Details TLV)

getValueByte(2)

Result is FEh (qualifier)

4

Search TLV 02h (Device Identities TLV)

getValueByte(0)

Result is 81h (Source)

5

initDisplayText()

buffer = 00 01 … 7D

length = 7Eh

Search TLV 0Dh (Text String TLV)

getValueByte(7E)

Result is 7Dh

6

initDisplayText()

buffer = 00 01 … 7D 7E

length = 7Fh

Search TLV 0Dh (Text String TLV)

getValueByte(7E)

Result is 7Dh

7

getValueByte(7F)

Result is 7Eh

8

initDisplayText()

buffer = 00 01 … EF

length = F0h

Search TLV 0Dh (Text String TLV)

getValueByte(F0)

Result is EFh

6.2.7.11.4 Test Coverage

CRR number

Test case number

N1

3, 4, 5, 6, 7, 8

P1

2

C1

Does not apply for Proactive Handler

C2

1

6.2.7.12 Method copyValue

Test Area Reference API_2_PAH_CPYVS_BSS

6.2.7.12.1 Conformance requirement

The method with following header shall be compliant with its definition in the API.

public short copyValue(short valueOffset,

byte[] dstBuffer,

short dstOffset,

short dstLength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.12.1.1 Normal execution

  • CRRN1: copies a part of the last TLV element which has been found, into a destination. buffer.
  • CRRN2: returns dstOffset + dstLength.

6.2.7.12.1.2 Parameter errors

  • CRRP1: if dstBuffer is null NullPointerException is thrown.
  • CRRP2: if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative ArrayIndexOutOfBoundsException is thrown.
  • CRRP3: if valueOffset is negative or valueOffset + dstLength > current TLV length, an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.

6.2.7.12.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
  • CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.

6.2.7.12.2 Test Suite files

Test Script: API_2_PAH_CPYVS_BSS_1.scr

Test Applet: API_2_PAH_CPYVS_BSS_1.java

Load Script: API_2_PAH_CPYVS_BSS_1.ldr

Cleanup Script: API_2_PAH_CPYVS_BSS_1.clr

Parameter File: API_2_PAH_CPYVS_BSS_1.par

6.2.7.12.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

Select a TLV

copyValue() with a null dstBuffer

NullPointerException is thrown

2

initDisplayText() with length = 15

Select Text String TLV

dstOffset > dstBuffer.length

dstBuffer.length = 5

dstOffset = 6

dstLength = 0

ArrayIndexOutOfBoundsException is thrown

3

dstOffset < 0

dstBuffer.length = 5

dstOffset = -1

dstLength = 1

ArrayIndexOutOfBoundsException is thrown

4

dstLength >dstBuffer.length

dstBuffer.length = 5

dstOffset = 0

dstLength = 6

ArrayIndexOutOfBoundsException is thrown

5

dstOffset + dstLength >dstBuffer.length

dstBuffer.length = 5

dstOffset = 3

dstLength = 3

ArrayIndexOutOfBoundsException is thrown

6

dstLength < 0

dstBuffer.length = 5

dstOffset = 0

dstLength = -1

ArrayIndexOutOfBoundsException is thrown

7

initDisplayText() with length = 5

Select Text String TLV

valueOffset > Text String Length

valueOffset = 7

dstBuffer.length = 15

dstOffset = 0

dstLength = 0

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

8

[Select Text String TLV]

valueOffset < 0

valueOffset = -1

dstBuffer.length = 15

dstOffset = 0

dstLength = 1

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

9

[Select Text String TLV]

dstLength > Text String length

valueOffset = 0

dstBuffer.length = 15

dstOffset = 0

dstLength = 7

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

10

[Select Text String TLV]

valueOffset + dstLength > Text String length

valueOffset = 2

dstBuffer.length = 15

dstOffset = 0

dstLength = 5

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

11

Initialise the handler

copyValue()

ToolkitException.UNAVAILABLE_ELEMENT is thrown

12

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Select Text String TLV

Successful call

valueOffset = 0

dstBuffer.length = 17

dstOffset = 0

dstLength = 17

Result of copyValue() is 17

13

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

14

initialise dstBuffer

dstBuffer = 55 55 … 55

Successful call

valueOffset = 2

dstBuffer.length = 20

dstOffset = 3

dstLength = 12

Result of copyValue() is 15

15

Compare buffer

buffer =

55 55 55 01 02

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Result is 00h

6.2.7.12.4 Test Coverage

CRR number

Test case number

N1

13, 15

N2

12, 14

P1

1

P2

2, 3, 4, 5, 6

P3

7, 8, 9, 10

C1

Does not apply for Proactive Handler

C2

11

6.2.7.13 Method compareValue

Test Area Reference API_2_PAH_CPRVS_BSS

6.2.7.13.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public byte compareValue(short valueOffset,

byte[] compareBuffer,

short compareOffset,

short compareLength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.13.1.1 Normal execution

Compares the last found TLV element with a buffer:

  • CRRN1: returns 0 if identical.
  • CRRN2: returns -1 if the first miscomparing byte in simple TLV List is less than that in compareBuffer.
  • CRRN3: returns 1 if the first miscomparing byte in simple TLV List is greater than that in compareBuffer.

6.2.7.13.1.2 Parameter errors

  • CRRP1: if compareBuffer is null NullPointerException shall be thrown.
  • CRRP2: if compareOffset or compareLength or both would cause access outside array bounds, or if compareLength is negative ArrayIndexOutOfBoundsException shall be thrown.
  • CRRP3: if valueOffset is negative or valueOffset + dstLength > current TLV length, an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.

6.2.7.13.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
  • CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.

6.2.7.13.2 Test Suite files

Test Script: API_2_PAH_CPRVS_BSS_1.scr

Test Applet: API_2_PAH_CPRVS_BSS_1.java

Load Script: API_2_PAH_CPRVS_BSS_1.ldr

Cleanup Script: API_2_PAH_CPRVS_BSS_1.clr

Parameter File: API_2_PAH_CPRVS_BSS_1.par

6.2.7.13.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

Select a TLV

compareValue() with a null compareBuffer

NullPointerException is thrown

2

initDisplayText() with length = 15

Select Text String TLV

compareOffset > compareBuffer.length

compareBuffer.length = 5

compareOffset = 6

compareLength = 0

ArrayIndexOutOfBoundsException is thrown

3

compareOffset < 0

compareBuffer.length = 5

compareOffset = -1

compareLength = 1

ArrayIndexOutOfBoundsException is thrown

4

compareLength >compareBuffer.length

compareBuffer.length = 5

compareOffset = 0

compareLength = 6

ArrayIndexOutOfBoundsException is thrown

5

compareOffset + compareLength >compareBuffer.length

compareBuffer.length = 5

compareOffset = 3

compareLength = 3

ArrayIndexOutOfBoundsException is thrown

6

compareLength < 0

compareBuffer.length = 5

compareOffset = 0

compareLength = -1

ArrayIndexOutOfBoundsException is thrown

7

initDisplayText() with length = 5

Select Text String TLV

valueOffset > Text String Length

valueOffset = 7

compareBuffer.length = 15

compareOffset = 0

compareLength = 0

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

8

[Select Text String TLV]

valueOffset < 0

valueOffset = -1

compareBuffer.length = 15

compareOffset = 0

compareLength = 1

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

9

[Select Text String TLV]

compareLength > Text String length

valueOffset = 0

compareBuffer.length = 15

compareOffset = 0

compareLength = 7

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

10

[Select Text String TLV]

valueOffset + compareLength > Text String length

valueOffset = 2

compareBuffer.length = 15

compareOffset = 0

compareLength = 5

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

11

Initialise the handler

compareValue()

ToolkitException.UNAVAILABLE_ELEMENT is thrown

12

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Select Text String TLV

Initialise compareBuffer

compareBuffer =

04 00 01 … 0F

Compare buffers

valueOffset = 0

compareOffset = 0

compareLength = 17

Result is 00h

13

Initialise compareBuffer

compareBuffer =

04 00 01 02 03

04 05 06 07 08

05 0A 0B 0C 0D

0E 10

Compare buffers with same parameters

Result is -1

14

Initialise compareBuffer

compareBuffer =

03 00 01 … 0F

Compare buffers with same parameters

Result is +1

15

Initialise compareBuffer

compareBuffer =

55 55 55 01 02

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Compare buffers

valueOffset = 2

compareOffset = 3

compareLength = 12

Result is 00h

16

Initialise compareBuffer

compareBuffer =

55 55 55 02 01

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Compare buffers with same parameters

Result is -1

17

Initialise compareBuffer

compareBuffer =

55 55 55 01 02

03 04 05 06 07

08 09 0A 0A 0D

55 55 55 55 55

Compare buffers with same parameters

Result is +1

18

Initialise compareBuffer

compareBuffer =

55 55 55 99 03

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Compare buffers with same parameters

Result is +1

6.2.7.13.4 Test Coverage

CRR number

Test case number

N1

12, 15

N2

13, 16

N3

14, 17, 18

P1

1

P2

2, 3, 4, 5, 6

P3

7, 8, 9, 10

C1

Does not apply for Proactive Handler

C2

11

6.2.7.14 Method findAndCopyValue(byte tag, byte[] dstBuffer, short valueOffset)

Test Area Reference API_2_PAH_FACYB_BS

6.2.7.14.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public short findAndCopyValue(byte tag,

byte[] dstBuffer,

short dstOffset)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.14.1.1 Normal execution

  • CRRN1: looks for the first occurrence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer.
  • CRRN2: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
  • CRRN3: if the method is successful then the corresponding TLV becomes current and dstOffset + length of the copied value is returned.
  • CRRN4: The search method is comprehension required flag independent.

6.2.7.14.1.2 Parameter errors

  • CRRP1: if dstBuffer is null NullPointerException shall be thrown.
  • CRRP2: if dstOffset would cause access outside array bounds ArrayIndexOutOfBoundsException shall be thrown.

6.2.7.14.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.

6.2.7.14.2 Test Suite files

Test Script: API_2_PAH_FACYB_BS_1.scr

Test Applet: API_2_PAH_FACYB_BS_1.java

Load Script: API_2_PAH_FACYB_BS_1.ldr

Cleanup Script: API_2_PAH_FACYB_BS_1.clr

Parameter File: API_2_PAH_FACYB_BS_1.par

6.2.7.14.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

FindAndCopyValue() with a null dstBuffer

NullPointerException is thrown

2

InitDisplayText() with length = 15

dstOffset > dstBuffer.length

tag = 0Dh

dstBuffer.length = 20

dstOffset = 21

ArrayIndexOutOfBoundsException is thrown

3

dstOffset < 0

dstBuffer.length = 20

dstOffset = -1

ArrayIndexOutOfBoundsException is thrown

4

length > dstBuffer.length

dstBuffer.length = 15

dstOffset = 0

ArrayIndexOutOfBoundsException is thrown

5

DstOffset + length >dstBuffer.length

DstBuffer.length = 20

DstOffset = 5

ArrayIndexOutOfBoundsException is thrown

6

initDisplayText()

Select a TLV (tag 02h)

findAndCopyValue()

tag = 03h

ToolkitException.UNAVAILABLE_ELEMENT is thrown

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown.

7

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Successful call

Tag = 0Dh

DstBuffer.length = 17

DstOffset = 0

Result of findAndcopyValue() is 17

8

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

9

initialise dstBuffer

dstBuffer = 55 55 … 55

Successful call

dstBuffer.length = 20

dstOffset = 2

Result of findAndcopyValue() is 19

10

Compare buffer

buffer =

55 55 04 00 01

02 03 04 05 06

07 08 09 0A 0B

0C 0D 0E 0F 55

Result is 00h

11

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

append a 2nd Text String TLV

Successful call

tag = 0Dh

dstBuffer.length = 17

dstOffset = 0

Result of findAndcopyValue() is 17

12

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

13

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Successful call (with tag 8Dh)

tag = 8Dh

dstBuffer.length = 17

dstOffset = 0

Result of findAndcopyValue() is 17

14

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

15

Append tag 0Fh

buffer = 00 01 … 0F

Successful call (with tag 8Fh)

tag = 8Fh

dstBuffer.length = 16

dstOffset = 0

Result of findAndcopyValue() is 16

16

Compare buffer

buffer = 00 01 … 0F

Result is 00h

6.2.7.14.4 Test Coverage

CRR number

Test case number

N1

8, 10, 12

N2

6

N3

7, 9, 11

N4

13, 14, 15, 16

P1

1

P2

2, 3, 4, 5

C1

Does not apply for Proactive Handler

6.2.7.15 Method findAndCopyValue(byte tag, byte occurence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength)

Test Area Reference API_2_PAH_FACYBBS_BSS

6.2.7.15.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public short findAndCopyValue(byte tag,

byte occurence,

short valueOffset,

byte[] dstBuffer,

short dstOffset,

short dstLength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.15.1.1 Normal execution

  • CRRN1: looks for the indicated occurrence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer.
  • CRRN2: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
  • CRRN3: if the method is successful then the corresponding TLV becomes current and dstOffset + dstLength is returned.
  • CRRN4: The search method is comprehension required flag independent.

6.2.7.15.1.2 Parameter errors

  • CRRP1: if dstBuffer is null NullPointerException shall be thrown.
  • CRRP2: if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative ArrayIndexOutOfBoundsException shall be thrown.
  • CRRP3: if valueOffset is negative or valueOffset + dstLength > current TLV length, an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.

6.2.7.15.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.

6.2.7.15.2 Test Suite files

Test Script: API_2_PAH_FACYBBS_BSS_1.scr

Test Applet: API_2_PAH_FACYBBS_BSS_1.java

Load Script: API_2_PAH_FACYBBS_BSS_1.ldr

Cleanup Script: API_2_PAH_FACYBBS_BSS_1.clr

Parameter File: API_2_PAH_FACYBBS_BSS_1.par

6.2.7.15.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

findAndCopyValue() with a null dstBuffer

NullPointerException is thrown

2

initDisplayText() with length = 15

dstOffset > dstBuffer.length

tag = 0Dh, occurrence = 1

valueOffset = 0

dstBuffer.length = 5

dstOffset = 6

dstLength = 0

ArrayIndexOutOfBoundsException is thrown

3

dstOffset < 0

dstBuffer.length = 5

dstOffset = -1

dstLength = 1

ArrayIndexOutOfBoundsException is thrown

4

dstLength >dstBuffer.length

dstBuffer.length = 5

dstOffset = 0

dstLength = 6

ArrayIndexOutOfBoundsException is thrown

5

dstOffset + dstLength >dstBuffer.length

dstBuffer.length = 5

dstOffset = 3

dstLength = 3

ArrayIndexOutOfBoundsException is thrown

6

dstLength < 0

dstBuffer.length = 5

dstOffset = 0

dstLength = -1

ArrayIndexOutOfBoundsException is thrown

7

initDisplayText() with length = 5

valueOffset > Text String Length

tag = 0Dh, occurrence = 1

valueOffset = 7

dstBuffer.length = 15

dstOffset = 0

dstLength = 0

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

8

valueOffset < 0

valueOffset = -1

dstBuffer.length = 15

dstOffset = 0

dstLength = 1

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

9

dstLength > Text String length

valueOffset = 0

dstBuffer.length = 15

dstOffset = 0

dstLength = 7

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

10

valueOffset + dstLength > Text String length

valueOffset = 2

dstBuffer.length = 15

dstOffset = 0

dstLength = 5

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

11

InitDisplayText()

Select a TLV (tag 02h)

findAndCopyValue()

tag = 0Dh

occurrence = 2

ToolkitException.UNAVAILABLE_ELEMENT is thrown

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown.

12

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Successful call

tag = 0Dh, occurrence = 1

valueOffset = 0

dstBuffer.length = 17

dstOffset = 0

dstLength = 17

Result of findAndCopyValue() is 17

13

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

14

initialise dstBuffer

dstBuffer = 55 55 … 55

Successful call

tag = 0Dh, occurrence = 1

valueOffset = 2

dstBuffer.length = 20

dstOffset = 3

dstLength = 12

Result of findAndcopyValue() is 15

15

Compare buffer

buffer =

55 55 55 01 02

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Result is 00h

16

Append a Text String TLV

tag = 0D

buffer = 00 11 22 33 44 55 (no specific DCS byte)

Successful call

tag = 0Dh, occurrence = 1

valueOffset = 0

dstBuffer.length = 17

dstOffset = 0

dstLength = 17

Result of findAndCopyValue() is 17

17

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

18

Successful call

tag = 0Dh, occurrence = 2

valueOffset = 0

dstBuffer.length = 6

dstOffset = 0

dstLength = 6

Result of findAndCopyValue() is 6

19

Compare buffer

buffer = 00 11 22 33 44 55

Result is 00h

20

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Successful call (with tag 8Dh)

tag = 8Dh

occurrence = 1

valueOffset = 0

dstBuffer.length = 17

dstOffset = 0

dstLength = 17

Result of findAndcopyValue() is 17

21

Compare buffer

buffer = 04 00 01 … 0F

Result is 00h

22

Append tag 0Fh

buffer = 00 01 … 0F

Successful call (with tag 8Fh)

tag = 8Fh

occurrence = 1

valueOffset = 0

dstBuffer.length = 16

dstOffset = 0

dstLength = 16

Result of findAndcopyValue() is 16

23

Compare buffer

buffer = 00 01 … 0F

Result is 00h

6.2.7.15.4 Test Coverage

CRR number

Test case number

N1

13, 15, 17, 19

N2

11

N3

12, 14, 16, 18

N4

20, 21, 22, 23

P1

1

P2

2, 3, 4, 5, 6

P3

7, 8, 9, 10

C1

Does not apply for ProactiveHandler

6.2.7.16 Method findAndCompareValue(byte tag, byte[] compareBuffer, short compareOffset)

Test Area Reference API_2_PAH_FACRB_BS

6.2.7.16.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public byte findAndCompareValue(byte tag,

byte[] compareBuffer,

short compareOffset)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.16.1.1 Normal execution

Looks for the first occurrence of a TLV element from beginning of a TLV list and compare its value with a buffer:

  • CRRN1: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
  • CRRN2: if the method is successful then the corresponding TLV becomes current.
  • CRRN3: if identical returns 0.
  • CRRN4: if the first miscomparing byte in simple TLV is less than that in compareBuffer returns -1.
  • CRRN5: if the first miscomparing byte in simple TLV is greater than that in compareBuffer returns 1.
  • CRRN6: The search method is comprehension required flag independent.

6.2.7.16.1.2 Parameter errors

  • CRRP1: if compareBuffer is null NullPointerException shall be thrown.
  • CRRP2: if compareOffset would cause access outside array bounds ArrayIndexOutOfBoundsException shall be thrown.

6.2.7.16.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.

6.2.7.16.2 Test Suite files

Test Script: API_2_PAH_FACRB_BS_1.scr

Test Applet: API_2_PAH_FACRB_BS_1.java

Load Script: API_2_PAH_FACRB_BS_1.ldr

Cleanup Script: API_2_PAH_FACRB_BS_1.clr

Parameter File: API_2_PAH_FACRB_BS_1.par

6.2.7.16.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

findAndCompareValue() with a null dstBuffer

NullPointerException is thrown

2

initDisplayText() with length = 15

compareOffset > compareBuffer.length

tag = 0Dh

compareBuffer.length = 20

compareOffset = 21

ArrayIndexOutOfBoundsException is thrown

3

compareOffset < 0

compareBuffer.length = 20

compareOffset = -1

ArrayIndexOutOfBoundsException is thrown

4

length > compareBuffer.length

compareBuffer.length = 15

compareOffset = 0

ArrayIndexOutOfBoundsException is thrown

5

compareOffset + length > compareBuffer.length

compareBuffer.length = 20

compareOffset = 5

ArrayIndexOutOfBoundsException is thrown

6

InitDisplayText()

Select a TLV (tag 02h)

findAndCompareValue()

tag = 03h

ToolkitException.UNAVAILABLE_ELEMENT is thrown

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown.

7

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Initialise compareBuffer

compareBuffer =

04 00 01 … 0F

Compare buffers

tag = 0Dh

compareOffset = 0

Result is 00h

8

Verify current TLV

getValueLength()

Result is 17

9

Initialise compareBuffer

compareBuffer =

04 00 01 … 10

Compare buffers with same parameters

Result is -1

10

Initialise compareBuffer

compareBuffer =

03 00 01 … 0F

Compare buffers with same parameters

Result is +1

11

Initialise compareBuffer

compareBuffer =

55 55 04 00 01

02 03 04 05 06

07 08 09 0A 0B

0C 0D 0E 0F 55

Compare buffers

compareOffset = 2

Result is 00h

12

append a Text String TLV

tag = 0Dh

buffer = 00 11 22 33 44 55

Initialise compareBuffer

compareBuffer =

55 55 04 00 01

02 03 04 05 06

07 08 09 0A 0B

0C 0D 0E 0F 55

Compare buffers

compareOffset = 2

Result is 00h

13

Initialise compareBuffer

compareBuffer =

55 55 04 01 01

02 03 04 05 06

07 08 09 0A 0B

0C 0D 0E 0F 55

Compare buffers

compareOffset = 2

Result is -1

14

Initialise compareBuffer

compareBuffer =

55 55 04 00 01

02 03 04 05 06

07 08 09 0A 0B

0C 0D 0D 10 55

Compare buffers

compareOffset = 2

Result is +1

15

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Initialise compareBuffer

CompareBuffer = 04 00 01 … 0F

Successful call (with tag 8Dh)

tag = 8Dh

compareBuffer.length = 17

compareOffset = 0

Result is 00h

16

Append tag 0Fh

buffer = 00 01 … 0F

Initialise compareBuffer

compareBuffer = 00 01 … 0F

Successful call (with tag 8Fh)

tag = 8Fh

compareBuffer.length = 16

compareOffset = 0

Result is 00h

17

Initialise compareBuffer

compareBuffer = 00 99 01 03 … 0F

Successful call (with tag 8Fh)

tag = 8Fh

compareBuffer.length = 16

compareOffset = 0

Result is +1

6.2.7.16.4 Test Coverage

CRR number

Test case number

N1

6

N2

8

N3

7, 11, 12, 17

N4

9, 13

N5

10, 14

N6

15, 16

P1

1

P2

2, 3, 4, 5

C1

Does not apply for Proactive Handler

6.2.7.17 Method findAndCompareValue(byte tag, byte occurence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength)

Test Area Reference API_2_PAH_FACRBBS_BSS

6.2.7.17.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public byte findAndCompareValue(byte tag,

byte occurence,

short valueOffset,

byte[] compareBuffer,

short compareOffset,

short compareLength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.17.1.1 Normal execution

Looks for the indicated occurrence of a TLV element from the beginning of a TLV list and compare its value with a buffer:

  • CRRN1: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
  • CRRN2: if the method is successful then the corresponding TLV becomes current.
  • CRRN3: if identical 0 is returned.
  • CRRN4: if the first miscomparing byte in simple TLV is less than that in compareBuffer -1 is returned.
  • CRRN5: if the first miscomparing byte in simple TLV is greater than that in compareBuffer 1 is returned.
  • CRRN6: The search method is comprehension required flag independent.

6.2.7.17.1.2 Parameter errors

  • CRRP1: if compareBuffer is null NullPointerException shall be thrown.
  • CRRP2: if compareOffset or compareLength or both would cause access outside array bounds, or if compareLength is negative ArrayIndexOutOfBoundsException shall be thrown.
  • CRRP3: if valueOffset is negative or valueOffset + dstLength > current TLV length, an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.
  • CRRP4: if an input parameter is not valid (e.g. occurrence = 0) an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException BAD_INPUT_PARAMETER.

6.2.7.17.1.3 Context errors

  • CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.

6.2.7.17.2 Test Suite files

Test Script: API_2_PAH_FACRBBS_BSS_1.scr

Test Applet: API_2_PAH_FACRBBS_BSS_1.java

Load Script: API_2_PAH_FACRBBS_BSS_1.ldr

Cleanup Script: API_2_PAH_FACRBBS_BSS_1.clr

Parameter File: API_2_PAH_FACRBBS_BSS_1.par

6.2.7.17.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

findAndCompareValue() with a null compareBuffer

NullPointerException is thrown

2

initDisplayText() with length = 15

compareOffset > compareBuffer.length

tag = 0Dh, occurrence = 1

valueOffset = 0

compareBuffer.length = 5

compareOffset = 6

compareLength = 0

ArrayIndexOutOfBoundsException is thrown

3

compareOffset < 0

compareBuffer.length = 5

compareOffset = -1

compareLength = 1

ArrayIndexOutOfBoundsException is thrown

4

compareLength >compareBuffer.length

compareBuffer.length = 5

compareOffset = 0

compareLength = 6

ArrayIndexOutOfBoundsException is thrown

5

compareOffset + compareLength >compareBuffer.length

compareBuffer.length = 5

compareOffset = 3

compareLength = 3

ArrayIndexOutOfBoundsException is thrown

6

compareLength < 0

compareBuffer.length = 5

compareOffset = 0

compareLength = -1

ArrayIndexOutOfBoundsException is thrown

7

initDisplayText() with length = 5

valueOffset > Text String Length

tag = 0Dh, occurrence = 1

valueOffset = 7

compareBuffer.length = 15

compareOffset = 0

compareLength = 0

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

8

valueOffset < 0

valueOffset = -1

compareBuffer.length = 15

compareOffset = 0

compareLength = 1

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

9

compareLength > Text String length

valueOffset = 0

compareBuffer.length = 15

compareOffset = 0

compareLength = 7

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

10

valueOffset + compareLength > Text String length

valueOffset = 2

compareBuffer.length = 15

compareOffset = 0

compareLength = 5

ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown

11

Invalid parameter

occurrence = 0

ToolkitException.BAD_INPUT_PARAMETER is thrown

12

InitDisplayText()

Select a TLV (tag 02h)

findAndCompareValue()

tag = 0Dh

occurrence = 2

ToolkitException.UNAVAILABLE_ELEMENT is thrown

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown.

13

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Initialise compareBuffer

compareBuffer =

04 00 01 … 0F

findAndCompareValue()

tag = 0Dh, occurrence = 1

valueOffset = 0

compareOffset = 0

compareLength = 17

Result is 00h

14

Verify current TLV

getValueLength()

Result is 17

15

Initialise compareBuffer

compareBuffer =

04 00 01 … 10

Compare buffers with same parameters

Result is -1

16

Initialise compareBuffer

compareBuffer =

03 00 01 … 0F

Compare buffers with same parameters

Result is +1

17

Initialise compareBuffer

compareBuffer =

55 55 55 01 02

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Compare buffers

valueOffset = 2

compareOffset = 3

compareLength = 12

Result is 00h

18

Initialise compareBuffer

compareBuffer =

55 55 55 02 01

03 04 05 06 07

08 09 0A 0B 0C

55 55 55 55 55

Compare buffers with same parameters

Result is -1

19

Initialise compareBuffer

compareBuffer =

55 55 55 01 02

03 04 05 06 07

08 09 0A 0A 0D

55 55 55 55 55

Compare buffers with same parameters

Result is +1

20

append a Text String TLV

tag = 0Dh

buffer = 00 11 22 33 44 55

Initialise compareBuffer

compareBuffer =

04 00 01 … 0F

findAndCompareValue()

tag = 0Dh, occurrence = 1

valueOffset = 0

compareOffset = 0

compareLength = 17

Result is 00h

21

Initialise compareBuffer

compareBuffer =

00 11 22 33 44 55

findAndCompareValue()

tag = 0Dh, occurrence = 2

valueOffset = 0

compareOffset = 0

compareLength = 6

Result is 00h

22

Initialise compareBuffer

compareBuffer =

00 11 22 33 44 66

findAndCompareValue()

tag = 0Dh, occurrence = 2

valueOffset = 0

compareOffset = 0

compareLength = 6

Result is -1

23

initDisplayText()

dcs = 4

buffer = 00 01 … 0F

Initialise compareBuffer

CompareBuffer = 04 00 01 … 0F

Successful call (with tag 8Dh)

tag = 8Dh, occurrence = 1

valueOffset = 0

compareBuffer.length = 17

compareOffset = 0

compareLength = 17

Result is 00h

24

Append tag 0Fh

buffer = 00 01 … 0F

Initialise compareBuffer

compareBuffer = 00 01 … 0F

Successful call (with tag 8Fh)

tag = 8Fh, occurrence = 1

valueOffset = 0

compareBuffer.length = 16

compareOffset = 0

compareLength = 16

Result is 00h

25

Initialise compareBuffer

compareBuffer =0099 02 … 0F

findAndCompareValue()

tag = 0Dh, occurrence = 1

valueOffset = 0

compareOffset = 0

compareLength = 17

Result is +1

6.2.7.17.4 Test Coverage

CRR number

Test case number

N1

12

N2

14

N3

13, 17, 20, 21

N4

15, 18, 22

N5

16, 19

N6

23, 24

P1

1

P2

2, 3, 4, 5, 6

P3

7, 8, 9, 10

P4

11

C1

Does not apply for Proactive Handler

6.2.7.18 Method appendArray

Test Area Reference: API_2_PAH_APDA_BSS

6.2.7.18.1 Conformance requirement:

The method with following header shall be compliant to its definition in the API.

void appendArray(byte[] buffer,

short offset,

short length)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.18.1.1 Normal execution

  • CRRN1: appends a buffer into the Edithandler buffer.
  • CRRN2: a successful append does not modify the TLV selected.

6.2.7.18.1.2 Parameters error

  • CRRP1: if buffer is null, a java.lang.NullPointerException is thrown.
  • CRRP2: if offset or length or both would cause access outside the array bounds, or if length is negative, a java.lang.ArrayIndexOutOfBoundsException is thrown.

6.2.7.18.1.3 Context errors

  • CRRC1: if the EditHandler buffer is too small to append the requested data, a ToolkitException is thrown with reason code HANDLER_OVERFLOW.
  • CRRC2: if the EditHandler buffer is busy, a ToolkitException is thrown with reason code HANDLER_NOT_AVAILABLE.

6.2.7.18.2 Test suite files

Test Script: API_2_PAH_APDA_BSS_1.scr

Test Applet: API_2_PAH_APDA_BSS_1.java

Load Script: API_2_PAH_APDA_BSS_1.ldr

Cleanup Script: API_2_PAH_APDA_BSS_1.clr

Parameter File: API_2_PAH_APDA_BSS_1.par

6.2.7.18.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Null buffer

NullPointerException is thrown

2

offset > buffer.length

buffer.length = 5

offset = 6

length = 0

ArrayIndexOutOfBoundsException is thrown

3

offset < 0

buffer.length = 5

offset = -1

length = 1

ArrayIndexOutOfBoundsException is thrown

4

length > buffer.length

buffer.length = 5

offset = 0

length = 6

ArrayIndexOutOfBoundsException is thrown

5

offset + length > buffer.length

buffer.length = 5

offset = 3

length = 3

ArrayIndexOutOfBoundsException is thrown

6

length < 0

buffer.length = 5

offset = 0

length = -1

ArrayIndexOutOfBoundsException is thrown

7

Handler overflow

buffer.length = 256

offset = 0

length = 256

ToolkitException.HANDLER_OVERFLOW is thrown

8

Initialise handler

Select Command Details TLV

Successful call

buffer = FF FE … F8

offset = 0

length = 8

Verify Current TLV: Call getValueLength()

Result is 03h

9

Clear the handler

Successful call

buffer = FF FE … F8

offset = 0

length = 8

Call copy() method

Compare the arrays

compareBuffer = FF FE … F8

Result of javacard.framework.Util.arrayCompare() is 00h

10

Successful call

buffer = 00 01 … 07

offset = 2

length = 6

Call copy() method

Compare the arrays

compareBuffer = FF FE … F8 02 03 … 07

Result of javacard.framework.Util.arrayCompare() is 00h

11

Successful call

buffer = 11 22 … 88

offset = 2

length = 4

Call copy() method

Compare the arrays

compareBuffer = FF FE … F8 02 03 … 07 33 44 55 66

Result of javacard.framework.Util.arrayCompare() is 00h

12

Clear the handler

Successful call

buffer = 00 01 … FC

offset = 0

length = 253

Call getLength() method

result = 253

Call copy() method

Compare handler

compareBuffer = 00 01 … FC

Result of javacard.framework.Util.arrayCompare() is 00h

6.2.7.18.4 Test Coverage

CRR number

Test case number

N1

9, 10, 11, 12

N2

8

P1

1

P2

2, 3, 4, 5, 6

C1

7

C2

Does not apply for ProactiveHandler

6.2.7.19 Method appendTLV(byte tag, byte value)

Test Area Reference: API_2_PAH_APTLBB

6.2.7.19.1 Conformance requirement:

The method with following header shall be compliant to its definition in the API.

void appendTLV(byte tag, byte value)

throws ToolkitException

6.2.7.19.1.1 Normal execution

  • CRRN1: Appends a TLV element to the current TLV list (1-byte element).
  • CRRN2: A successful append does not modify the TLV selected.

6.2.7.19.1.2 Parameters error

No requirements

6.2.7.19.1.3 Context errors

  • CRRC1: if the EditHandler buffer is too small to append the requested data, a ToolkitException is thrown with reason code HANDLER_OVERFLOW.
  • CRRC2: if the EditHandler buffer is busy, a ToolkitException is thrown with reason code HANDLER_NOT_AVAILABLE.

6.2.7.19.2 Test suite files

Test Script: API_2_PAH_APTLBB_1.scr

Test Applet: API_2_PAH_APTLBB_1.java

Load Script: API_2_PAH_APTLBB_1.ldr

Cleanup Script: API_2_PAH_APTLBB_1.clr

Parameter File: API_2_PAH_APTLBB_1.par

6.2.7.19.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Call appendArray()

length = 251

Handler Overflow: Call the appendTLV() method

ToolkitException.HANDLER_OVERFLOW is thrown

2

Initialise handler

Select Command Details TLV

Call the appendTLV() method

Verify Current TLV: Call getValueLength()

Result is 03h

3

Clear the handler

Successful call

tag = 84h

value = 00h

Call copy() method

Compare the arrays

compareBuffer = 84 01 00

Result of javacard.framework.Util.arrayCompare() is 00h

4

Successful call

tag = 01h

value = FEh

Call copy() method

Compare the arrays

compareBuffer = 84 01 00 01 01 FE

Result of javacard.framework.Util.arrayCompare() is 00h

5

Clear the handler

Call appendArray()

length = 250

buffer = 00 81 F7 03 04 … F9

Successful call

tag = 84h

value = 00h

Call getLength() method

result = 253

Call copy() method

Compare the array

compareBuffer = 00 81 F7 03 04 … F9 84 01 00

Result of javacard.framework.Util.arrayCompare() is 00h

6.2.7.19.4 Test Coverage

CRR number

Test case number

N1

3, 4, 5

N2

2

C1

1

C2

Does not apply for Proactive Handler

6.2.7.20 Method appendTLV(byte tag, byte value1, byte value2)

Test Area Reference: API_2_PAH_APTLBBB

6.2.7.20.1 Conformance requirements:

The method with following header shall be compliant to its definition in the API.

public void appendTLV(byte tag,

byte value1,

byte value2)

throws ToolkitException

6.2.7.20.1.1 Normal execution

  • CRRN1: Appends a TLV element to the current TLV list (2-byte element).
  • CRRN2: A successful append does not modify the TLV selected.

6.2.7.20.1.2 Parameters error

No requirements

6.2.7.20.1.3 Context errors

  • CRRC1: if the EditHandler buffer is too small to append the requested data, a ToolkitException is thrown with reason code HANDLER_OVERFLOW.
  • CRRC2: if the EditHandler buffer is busy, a ToolkitException is thrown with reason code HANDLER_NOT_AVAILABLE.

6.2.7.20.2 Test suite files

Test Script: API_2_PAH_APTLBBB_1.scr

Test Applet: API_2_PAH_APTLBBB_1.java

Load Script: API_2_PAH_APTLBBB_1.ldr

Cleanup Script: API_2_PAH_APTLBBB_1.clr

Parameter File: API_2_PAH_APTLBBB_1.par

6.2.7.20.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Call the initDisplayText()

length = 250

Handler Overflow: Call the appendTLV() method

ToolkitException.HANDLER_OVERFLOW is thrown

2

Initialise handler

Select Command Details TLV

Call the appendTLV() method

Verify Current TLV: Call getValueLength()

Result is 03h

3

Clear the handler

Successful call

tag = 84h

value1 = 00h

value2 = 01h

Call copy() method

Compare the arrays

compareBuffer = 84 02 00 01

Result of javacard.framework.Util.arrayCompare() is 00h

4

Successful call

tag = 01h

value1 = FEh

value2 = FDh

Call copy() method

Compare the arrays

compareBuffer = 84 02 00 01 01 02 FE FD

Result of javacard.framework.Util.arrayCompare() is 00h

5

Clear the handler

Call appendArray()

length = 249

buffer = 00 81 F6 03 04 … F8

Successful call

tag = 84h

value1 = 00h

value2 = 01h

Call getLength() method

result = 253

Call copy() method

Compare handler

compareBuffer = 00 81 F6 03 04 … F8 84 02 00 01

Result of javacard.framework.Util.arrayCompare() is 00h

6.2.7.20.4 Test Coverage

CRR number

Test case number

N1

3, 4, 5

N2

2

C1

1

C2

Does not apply for Proactive Handler

6.2.7.21 Method appendTLV(byte tag, byte[] value, short valueoffset, short valuelength)

Test Area Reference: API_2_PAH_APTLB_BSS

6.2.7.21.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

void appendTLV(byte tag,

byte[] value,

short valueoffset,

short valuelength)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.21.1.1 Normal execution

  • CRRN1: Appends a TLV element to the current TLV list (byte-array element).
  • CRRN2: A successful append does not modify the TLV selected.

6.2.7.21.1.2 Parameters error

  • CRRP1: if value is null, a java.lang.NullPointerException is thrown.
  • CRRP2: if valueoffset or valuelength or both would cause access outside the array bounds, or if length is negative, a java.lang.ArrayIndexOutOfBoundsException is thrown.

6.2.7.21.1.3 Context errors

  • CRRC1: if the EditHandler buffer is too small to append the requested data, a ToolkitException is thrown with reason code HANDLER_OVERFLOW.
  • CRRC2: if the EditHandler buffer is busy, a ToolkitException is thrown with reason code HANDLER_NOT_AVAILABLE.
  • CRRC3: if valuelength is greater than 255, a ToolkitException is thrown with reason code BAD_INPUT_PARAMETER.

6.2.7.21.2 Test suite files

Test Script: API_2_PAH_APTLB_BSS_1.scr

Test Applet: API_2_PAH_APTLB_BSS_1.java

Load Script: API_2_PAH_APTLB_BSS_1.ldr

Cleanup Script: API_2_PAH_APTLB_BSS_1.clr

Parameter File: API_2_PAH_APTLB_BSS_1.par

6.2.7.21.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Null value

NullPointerException is thrown

2

valueOffset > value.length

value.length = 5

valueOffset = 6

valueLength = 0

ArrayIndexOutOfBoundsException is thrown

3

valueOffset < 0

value.length = 5

valueOffset = -1

valueLength = 1

ArrayIndexOutOfBoundsException is thrown

4

valueLength > value.length

value.length = 5

valueOffset = 0

valueLength = 6

ArrayIndexOutOfBoundsException is thrown

5

valueOffset + valueLength > value.length

value.length = 5

valueOffset = 3

valueLength = 3

ArrayIndexOutOfBoundsException is thrown

6

valueLength < 0

value.length = 5

valueOffset = 0

valueLength = -1

ArrayIndexOutOfBoundsException is thrown

7

Handler overflow

value.length = 256

valueOffset = 0

valueLength = 251

ToolkitException.HANDLER_OVERFLOW is thrown

8

Bad parameter

value.length = 256

valueOffset = 0

valueLength = 256

ToolkitException.BAD_INPUT_PARAMETER is thrown

9

Initialise handler

Select Command Details TLV

Successful call

tag = 04

value = FF FE … F8

valueOffset = 0

valueLength = 8

Verify Current TLV: Call getValueLength()

Result is 03h

10

Clear the handler

Successful call

tag = 04

value = FF FE … F8

valueOffset = 0

valueLength = 8

Call copy() method

Compare the arrays

compareBuffer = 04 08 FF FE … F8

Result of javacard.framework.Util.arrayCompare() is 00h

11

Successful call

tag = 85h

value = 00 01 … 07

valueOffset = 2

valueLength = 6

Call copy() method

Compare the arrays

compareBuffer = 04 08 FF FE … F8 85 06 02 03 … 07

Result of javacard.framework.Util.arrayCompare() is 00h

12

Successful call

tag = 01

value = 11 22 … 88

valueOffset = 2

valueLength = 4

Call copy() method

Compare the arrays

compareBuffer = 04 08 FF FE … F8 85 06 02 03 … 07 01 04 33 44 55 66

Result of javacard.framework.Util.arrayCompare() is 00h

13

Clear the handler

Successful call

tag = 04

value = 00 01 … 7F

valueOffset = 0

valueLength = 80h

Call copy() method

Compare the arrays

compareBuffer = 04 81 80 00 01…7F

Result of javacard.framework.Util.arrayCompare() is 00h

14

Clear the handler

Successful call

tag = 04

value = 00 01 … F9

valueOffset = 0

valueLength = 250

Call getLength() method

result = 253

Call copy() method

Compare handler

compareBuffer = 04 81 FA 00 01…F9

Result of javacard.framework.Util.arrayCompare() is 00h

6.2.7.21.4 Test Coverage

CRR number

Test case number

N1

10, 11, 12, 13, 14

N2

9

P1

1

P2

2, 3, 4, 5, 6

C1

7

C2

Does not apply for Proactive Handler

C3

8

6.2.7.22 Method appendTLV(byte tag, byte value1, byte[] value2, short value2offset, short value2length)

Test Area Reference: API_2_PAH_APTLBB_BSS

6.2.7.22.1 Conformance requirement:

The method with following header shall be compliant to its definition in the API.

void appendTLV(byte tag,

byte value1

byte[] value2,

short value2offset,

short value2length)

throws java.lang.NullPointerException,

java.lang.ArrayIndexOutOfBoundsException,

ToolkitException

6.2.7.22.1.1 Normal execution

  • CRRN1: Appends a TLV element to the current TLV list (1 byte and a byte-array element).
  • CRRN2: A successful append does not modify the TLV selected.

6.2.7.22.1.2 Parameters error

  • CRRP1: if value2 is null, a java.lang.NullPointerException is thrown.
  • CRRP2: if value2offset or value2length or both would cause access outside the array bounds, or if length is negative, a java.lang.ArrayIndexOutOfBoundsException is thrown.

6.2.7.22.1.3 Context errors

  • CRRC1: if the EditHandler buffer is too small to append the requested data, a ToolkitException is thrown with reason code HANDLER_OVERFLOW.
  • CRRC2: if the EditHandler buffer is busy, a ToolkitException is thrown with reason code HANDLER_NOT_AVAILABLE.
  • CRRC3: if valuelength is greater than 255, a ToolkitException is thrown with reason code BAD_INPUT_PARAMETER.

6.2.7.22.2 Test suite files

Test Script: API_2_PAH_APTLBB_BSS_1.scr

Test Applet: API_2_PAH_APTLBB_BSS_1.java

Load Script: API_2_PAH_APTLBB_BSS_1.ldr

Cleanup Script: API_2_PAH_APTLBB_BSS_1.clr

Parameter File: API_2_PAH_APTLBB_BSS_1.par

6.2.7.22.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Null value2

NullPointerException is thrown

2

value2Offset > value2.length

value2.length = 5

value2Offset = 6

value2Length = 0

ArrayIndexOutOfBoundsException is thrown

3

value2Offset < 0

value2.length = 5

value2Offset = -1

value2Length = 1

ArrayIndexOutOfBoundsException is thrown

4

value2Length > value2.length

value2.length = 5

value2Offset = 0

value2Length = 6

ArrayIndexOutOfBoundsException is thrown

5

value2Offset + value2Length > value2.length

value2.length = 5

value2Offset = 3

value2Length = 3

ArrayIndexOutOfBoundsException is thrown

6

value2Length < 0

value2.length = 5

value2Offset = 0

value2Length = -1

ArrayIndexOutOfBoundsException is thrown

7

Handler overflow

value2.length = 254

value2Offset = 0

value2Length = 254

ToolkitException.HANDLER_OVERFLOW is thrown

8

Bad parameter

value2.length = 256

value2Offset = 0

value2Length = 256

ToolkitException.BAD_INPUT_PARAMETER is thrown

9

Initialise handler

Select Command Details TLV

Successful call

tag = 04

value1 = 05

value2 = FF FE … F8

value2Offset = 0

value2Length = 8

Verify Current TLV: Call getValueLength()

Result is 03h

10

Clear the handler

Successful call

tag = 04

value1 = 05

value2 = FF FE … F8

value2Offset = 0

value2Length = 8

Call copy() method

Compare the arrays

CompareBuffer = 04 09 05 FF FE … F8

Result of javacard.framework.Util.arrayCompare() is 00h

11

Successful call

tag = 85h

value1 = 55h

value2 = 00 01 … 07

value2Offset = 2

value2Length = 6

Call copy() method

Compare the arrays

compareBuffer =

04 09 05 FF FE … F8

85 07 55 02 03 … 07

Result of javacard.framework.Util.arrayCompare() is 00h

12

Successful call

tag = 01

value1 = 44h

value2 = 11 22 … 88

value2Offset = 2

value2Length = 4

Call copy() method

Compare the arrays

CompareBuffer =

04 09 05 FF FE … F8

85 07 55 02 03 … 07

01 05 44 33 44 55 66

Result of javacard.framework.Util.arrayCompare() is 00h

13

Clear the handler

Successful call

tag = 04

value1 = 00

value2 = 01 … 7F

value2Offset = 0

value2Length = 7Fh

Call copy() method

Compare the arrays

compareBuffer = 04 81 80 00 01…7F

Result of javacard.framework.Util.arrayCompare() is 00h

14

Clear the handler

Successful call

tag = 04

value1 = 00

value2 = 01 … F9

value2Offset = 0

value2Length = 249

Call getLength() method

result = 253

Call copy() method

Compare handler

compareBuffer = 04 81 FA 00 01…F9

Result of javacard.framework.Util.arrayCompare() is 00h

6.2.7.22.4 Test Coverage

CRR number

Test case number

N1

10, 11, 12, 13, 14

N2

9

P1

1

P2

2, 3, 4, 5, 6

C1

7

C2

Does not apply for Proactive Handler

C3

8

6.2.7.23 Method clear

Test Area Reference: API_2_PAH_CLER

6.2.7.23.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

void clear()

throws ToolkitException EditHandler

6.2.7.23.1.1 Normal execution

  • CRRN1: Clears the TLV list of an EditHandler
  • CRRN2: Resets the current TLV selected.

6.2.7.23.1.2 Parameters error

No requirements

6.2.7.23.1.3 Context errors

  • CRRC1: if the EditHandler buffer is busy, a ToolkitException is thrown with reason code HANDLER_NOT_AVAILABLE

6.2.7.23.2 Test suite files

Test Script: API_2_PAH_CLER_1.scr

Test Applet: API_2_PAH_CLER_1.java

Load Script: API_2_PAH_CLER_1.ldr

Cleanup Script: API_2_PAH_CLER_1.clr

Parameter File: API_2_PAH_CLER_1.par

6.2.7.23.3 Test procedure

Id

Description

API Expectation

APDU Expectation

1

Initialise the handler

Select Command Details TLV

Call the getLength() method

Result of getLength() is not null

Clear the handler

Call the getLength() method

Result of getLength() is 0

2

Call the getValueLength() method

ToolkitException.UNAVAILABLE_ELEMENT is thrown

6.2.7.23.4 Test Coverage

CRR number

Test case number

N1

1

N2

2

C1

Does not apply for Proactive Handler

6.2.7.24 Method getCapacity

Test Area Reference: API_2_PAH_GCAP

6.2.7.24.1 Conformance Requirement

The method with following header shall be compliant to its definition in the API.

public byte getCapacity()

6.2.7.24.1.1 Normal execution

  • CRRN1: The method shall return the maximum size of the Simple TLV list managed by the handler.

6.2.7.24.2 Test suite files

Test Script: API_2_PAH_GCAP_1.scr

Test Applet: API_2_PAH_GCAP_1.java

Load Script: API_2_PAH_GCAP_1.ldr

Cleanup Script: API_2_PAH_GCAP_1.clr

Parameter File: API_2_PAH_GCAP_1.par

6.2.7.24.3 Test Procedure

Id

Description

API Expectation

APDU Expectation

1

ProactiveHandler available

1- Send envelope SMS-PP Formatted

2- The applet calls getTheHandler()

3- The applet calls getCapacity() on the ProactiveHandler

4- The applet fills the handler with the maximum capacity, using appendTLV() method

5- The applet calls clear() on the proactive handler

6- The applet fills the handler with the maximum capacity plus one, using appendTLV() method

1- Applet is triggered

2- No exception is thrown

3- No exception is thrown, the capacity shall not be null

4- No exception is thrown

5- No exception is thrown

6- HANDLER_OVERFLOW exception is thrown

6.2.7.24.4 Test Coverage

CRR number

Test case number

N1

1

6.2.7.25 Method initCloseChannel

Test Area Reference: API_2_PAH_ICCHB

6.2.7.25.1 Conformance requirement

The method with following header shall be compliant to its definition in the API.

public void initCloseChannel(byte bChannelIdentifier)

6.2.7.25.1.1 Normal execution

  • CRRN1: The method shall build a Close Channel Proactive command, using Channel Identifier. Comprehension Required flags are set.
  • CRRN2: A call to this method clears the handler then initialises it with Close Channel Proactive command.
  • CRRN3: After the method invocation, no TLV is selected.
  • CRRN4: The Close Channel Proactive command is not sent by the method.

6.2.7.25.2 Test suite files

Test Script: API_2_PAH_ICCHB_1.scr

Test Applet: API_2_PAH_ICCHB_1.java

Load Script: API_2_PAH_ICCHB_1.ldr

Cleanup Script: API_2_PAH_ICCHB_1.clr

Parameter File: API_2_PAH_ICCHB_1.par

6.2.7.25.3 Test procedure

Id

Description

API Expectation

APDU Expectation

0

Applet1 is installed with maximum number of channel = 01.

1

Call initCloseChannel() method

1- Call ProactiveHandler.init() method to Open a Channel.

Call the ProactiveHandler.send() method.

2- Send an EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS Envelope.

3- Call the ProactiveHandler.initCloseChannel() method with Channel Id = 01.

4- Call the ProactiveHandler.send() method.

5- Send an EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS Envelope.

2- Applet1 is triggered.

5- Applet1 is not triggered.

1- OPEN CHANNEL proactive command is fetched.

TERMINAL RESPONSE of OPEN CHANNEL is sent to the SIM with Channel Id = 01.

4- CLOSE CHANNEL proactive command is fetched.

TERMINAL RESPONSE of CLOSE CHANNEL is sent to the SIM.

2

Call the initCloseChannel () method with any value then build and send a Close Channel command

1- Call ProactiveHandler.init() to Open a Channel and ProactiveHandler.send() methods.

2- ProactiveHandler.initCloseChannel() with Channel Id = 2

3- ProactiveHandler.initCloseChannel() with the Channel Id = 1.

4- call the send() method.

5- Send an EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS Envelope.

5- Applet1 is not triggered.

1- OPEN CHANNEL proactive command is fetched.

TERMINAL RESPONSE of OPEN CHANNEL is sent to the SIM with Channel Id = 01.

4- CLOSE CHANNEL proactive command is fetched.

TERMINAL RESPONSE of CLOSE CHANNEL is sent to the SIM.

3

Select a TLV in the ProactiveHandler

Call the initCloseChannel () method

1- Call ProactiveHandler.init() method to open a Channel and call the ProactiveHandler.send() method.

Select 1st TLV of the Proactive Handler.

2- Call ProactiveHandler.initCloseChannel() method with Channel Id = 01.

3- Call the ViewHandler.getValueLength() method.

4- Call ProactiveHandler.send() method.

3- UNAVAILABLE_ELEMENT ToolkitException is thrown by getValueLength() method.

1- OPEN CHANNEL proactive command is fetched.

TERMINAL RESPONSE of OPEN CHANNEL is sent to the SIM with Channel Id = 01.

4- CLOSE CHANNEL proactive command is fetched.

TERMINAL RESPONSE of CLOSE CHANNEL is sent to the SIM.

4

Call the initCloseChannel() without sending the command

1- Call ProactiveHandler.init() method to open a Channel and call the ProactiveHandler.send() method.

2- Call the ProactiveHandler.initCloseChannel() method with Channel Id = 01 without ProactiveHandler.send().

3- Send an EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS Envelope.

3- Applet1 is triggered.

1- OPEN CHANNEL proactive command is fetched.

TERMINAL RESPONSE of OPEN CHANNEL is sent to the SIM with Channel Id = 01.

No proactive command shall be sent. Expected status is ‘9000’

6.2.7.25.4 Test Coverage

CRR number

Test case number

N1

1

N2

2

N3

3

N4

2, 4