1313
1414import org .calypsonet .terminal .calypso .GetDataTag ;
1515import org .calypsonet .terminal .calypso .SelectFileControl ;
16+ import org .calypsonet .terminal .calypso .WriteAccessLevel ;
1617import org .calypsonet .terminal .reader .selection .spi .CardSelection ;
1718
1819/**
@@ -226,13 +227,13 @@ public interface CalypsoCardSelection extends CardSelection {
226227 CalypsoCardSelection prepareReadRecordFile (byte sfi , int recordNumber );
227228
228229 /**
229- * Adds a command APDU to read a single record from the indicated EF.
230+ * Adds an APDU command to read a single record from the indicated Linear or Cyclic EF.
230231 *
231232 * <p>Once this command is processed, the result is available in {@link CalypsoCard} if the
232- * requested file and record exist in the file structure of the card (best effort behavior ).
233+ * requested file and record exist in the file structure of the card (best- effort mode ).
233234 *
234- * <p>Caution: the resulting APDU command must be compliant with PRIME revision 3 cards.
235- * Therefore, the command may be rejected by some earlier revision cards.
235+ * <p>Caution: the resulting APDU command is compliant with PRIME revision 3 cards. Therefore, the
236+ * command may be rejected by some earlier revision cards.
236237 *
237238 * @param sfi The SFI of the EF to read
238239 * @param recordNumber The record number to read.
@@ -242,40 +243,62 @@ public interface CalypsoCardSelection extends CardSelection {
242243 */
243244 CalypsoCardSelection prepareReadRecord (byte sfi , int recordNumber );
244245
245- // /**
246- // * Adds an APDU command to attempt a secure session pre-opening. For cards that support this
247- // * feature, this optimizes exchanges with the card in the case of deterministic secure
248- // sessions
249- // * that can be executed in a single step.
250- // *
251- // * <p>The use of this method or one of the following methods is a prerequisite for the use of
252- // the
253- // * {@link CardTransactionManager#processPreOpenedSecureSession()} method:
254- // *
255- // * <ul>
256- // * <li>{@link #preparePreOpenSecureSession(WriteAccessLevel, byte, int)}
257- // * <li>{@link CardTransactionManager#preparePreOpenSecureSession(WriteAccessLevel)}
258- // * <li>{@link CardTransactionManager#preparePreOpenSecureSession(WriteAccessLevel, byte,
259- // int)}
260- // * </ul>
261- // *
262- // * It is not advised to use it in other cases.
263- // *
264- // * <p>The secure session opening which will be done by {@link
265- // * CardTransactionManager#processPreOpenedSecureSession()} will use the same parameters (same
266- // * {@link WriteAccessLevel}, no record reading).
267- // *
268- // * @param writeAccessLevel The write access level.
269- // * @return The object instance.
270- // * @throws IllegalArgumentException If writeAccessLevel is null.
271- // * @throws IllegalStateException If "Pre-Open" command is already prepared.
272- // * @see #preparePreOpenSecureSession(WriteAccessLevel, byte, int)
273- // * @see CardTransactionManager#preparePreOpenSecureSession(WriteAccessLevel)
274- // * @see CardTransactionManager#preparePreOpenSecureSession(WriteAccessLevel, byte, int)
275- // * @see CardTransactionManager#processPreOpenedSecureSession()
276- // * @since 1.6.0
277- // */
278- // CalypsoCardSelection preparePreOpenSecureSession(WriteAccessLevel writeAccessLevel);
246+ /**
247+ * Adds one or multiple APDU commands to read all or part of the indicated Binary EF.
248+ *
249+ * <p>Once this command is processed, the result is available in {@link CalypsoCard} if the
250+ * requested file exist in the file structure of the card and if the offset and number of bytes to
251+ * read are valid (best-effort mode).
252+ *
253+ * <p>Caution: the resulting APDU command is compliant with PRIME revision 3 cards. Therefore, the
254+ * command may be rejected by some earlier revision cards.
255+ *
256+ * @param sfi The SFI of the EF.
257+ * @param offset The offset (0 indicates the first byte).
258+ * @param nbBytesToRead The number of bytes to read.
259+ * @return The current instance.
260+ * @throws IllegalArgumentException If one of the provided argument is out of range.
261+ * @since 1.7.0
262+ */
263+ CalypsoCardSelection prepareReadBinary (byte sfi , int offset , int nbBytesToRead );
264+
265+ /**
266+ * Adds an APDU command to read a part of a record of the indicated EF, which should be a counter
267+ * file.
268+ *
269+ * <p>The record will be read up to the counter location indicated in parameter.<br>
270+ * Thus, all previous counters will also be read.
271+ *
272+ * <p>Once this command is processed, the result is available in {@link CalypsoCard} if the
273+ * requested file and the counter number exist in the file structure of the card (best-effort
274+ * mode).
275+ *
276+ * <p>Caution: the resulting APDU command is compliant with PRIME revision 3 cards. Therefore, the
277+ * command may be rejected by some earlier revision cards.
278+ *
279+ * @param sfi The SFI of the EF.
280+ * @param nbCountersToRead The number of counters to read.
281+ * @return The current instance.
282+ * @throws IllegalArgumentException If one of the provided argument is out of range.
283+ * @since 1.7.0
284+ */
285+ CalypsoCardSelection prepareReadCounter (byte sfi , int nbCountersToRead );
286+
287+ /**
288+ * Adds an APDU command to attempt a secure session pre-opening. For cards that support this
289+ * feature, this optimizes future exchanges with the card in the case of secure sessions intended
290+ * to be executed in a single step.
291+ *
292+ * <p>Caution: the resulting APDU command is compliant with PRIME revision 3 cards supporting the
293+ * extended mode. Therefore, the command may be rejected by some earlier revision cards.
294+ *
295+ * @param writeAccessLevel The write access level.
296+ * @return The object instance.
297+ * @throws IllegalArgumentException If writeAccessLevel is null.
298+ * @throws IllegalStateException If "Pre-Open" command is already prepared.
299+ * @since 1.7.0
300+ */
301+ CalypsoCardSelection preparePreOpenSecureSession (WriteAccessLevel writeAccessLevel );
279302
280303 /**
281304 * Navigation options through the different applications contained in the card according to the
0 commit comments