1616import org .calypsonet .terminal .calypso .WriteAccessLevel ;
1717import org .calypsonet .terminal .calypso .card .CalypsoCard ;
1818import org .calypsonet .terminal .calypso .card .ElementaryFile ;
19- import org .calypsonet .terminal .calypso .card .FileData ;
2019import org .calypsonet .terminal .reader .CardReader ;
2120
2221/**
@@ -125,14 +124,29 @@ public interface CardTransactionManager {
125124 *
126125 * <p>Once this command is processed, the result is available in {@link CalypsoCard}.
127126 *
128- * <p>See the method {@link CalypsoCard#getFileBySfi(byte)}, the objects {@link ElementaryFile},
129- * {@link FileData} and their specialized methods according to the type of expected data: e.g.
130- * {@link FileData#getContent(int)}.
127+ * <p>Depending on whether or not we are inside a secure session, there are two types of behavior
128+ * following this command:
129+ *
130+ * <ul>
131+ * <li>Outside a secure session (best effort mode): the following "process" command will not
132+ * fail whatever the existence of the targeted file or record (the {@link CalypsoCard}
133+ * object may not be filled).
134+ * <li>Inside a secure session in contactless mode (strict mode): the following "process"
135+ * command will fail if the targeted file or record does not exist (the {@link CalypsoCard}
136+ * object is always filled or an exception is raised when the reading failed).
137+ * </ul>
138+ *
139+ * <p><b>This method should not be used inside a secure session in contact mode</b> because
140+ * additional exchanges with the card will be operated and will corrupt the security of the
141+ * session. Instead, use the method {@link #prepareReadRecordFile(byte, int, int, int)} for this
142+ * case and provide valid parameters.
131143 *
132144 * @param sfi The SFI of the EF to read.
133145 * @param recordNumber The record number to read.
134146 * @return The current instance.
135147 * @throws IllegalArgumentException If one of the provided arguments is out of range.
148+ * @throws IllegalStateException If this method is invoked inside a secure session in contact
149+ * mode.
136150 * @since 1.0.0
137151 */
138152 CardTransactionManager prepareReadRecordFile (byte sfi , int recordNumber );
@@ -143,12 +157,22 @@ public interface CardTransactionManager {
143157 *
144158 * <p>Once this command is processed, the result is available in {@link CalypsoCard}.
145159 *
146- * <p>See the method {@link CalypsoCard#getFileBySfi(byte)}, the objects {@link ElementaryFile},
147- * {@link FileData} and their specialized methods according to the type of expected data: e.g.
148- * {@link FileData#getContent()}.
160+ * <p>Depending on whether or not we are inside a secure session, there are two types of behavior
161+ * following this command:
162+ *
163+ * <ul>
164+ * <li>Outside a secure session (best effort mode): the following "process" command will not
165+ * fail whatever the existence of the targeted file or record (the {@link CalypsoCard}
166+ * object may not be filled).
167+ * <li>Inside a secure session (strict mode): the following "process" command will fail if the
168+ * targeted file or record does not exist (the {@link CalypsoCard} object is always filled
169+ * or an exception is raised when the reading failed).<br>
170+ * Invalid parameters could lead to additional exchanges with the card and thus corrupt the
171+ * security of the session.
172+ * </ul>
149173 *
150174 * @param sfi The SFI of the EF.
151- * @param firstRecordNumber The record number to read (or first record to read in case of several.
175+ * @param firstRecordNumber The record number to read (or first record to read in case of several
152176 * records)
153177 * @param numberOfRecords The number of records expected.
154178 * @param recordSize The record length.
@@ -164,13 +188,23 @@ CardTransactionManager prepareReadRecordFile(
164188 * which should be a counter file.
165189 *
166190 * <p>The record will be read up to the counter location indicated in parameter.<br>
167- * Thus all previous counters will also be read.
191+ * Thus, all previous counters will also be read.
168192 *
169193 * <p>Once this command is processed, the result is available in {@link CalypsoCard}.
170194 *
171- * <p>See the method {@link CalypsoCard#getFileBySfi(byte)}, the objects {@link ElementaryFile},
172- * {@link FileData} and their specialized methods according to the type of expected data: e.g.
173- * {@link FileData#getAllCountersValue()} (int)}.
195+ * <p>Depending on whether or not we are inside a secure session, there are two types of behavior
196+ * following this command:
197+ *
198+ * <ul>
199+ * <li>Outside a secure session (best effort mode): the following "process" command will not
200+ * fail whatever the existence of the targeted file or counter (the {@link CalypsoCard}
201+ * object may not be filled).
202+ * <li>Inside a secure session (strict mode): the following "process" command will fail if the
203+ * targeted file or counter does not exist (the {@link CalypsoCard} object is always filled
204+ * or an exception is raised when the reading failed).<br>
205+ * Invalid parameters could lead to additional exchanges with the card and thus corrupt the
206+ * security of the session.
207+ * </ul>
174208 *
175209 * @param sfi The SFI of the EF.
176210 * @param countersNumber The number of the last counter to be read.
0 commit comments