Interface StorageCard

All Superinterfaces:
org.eclipse.keypop.reader.selection.spi.SmartCard

public interface StorageCard extends org.eclipse.keypop.reader.selection.spi.SmartCard
Represents a storage card with various methods to retrieve information and data from it.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    getBlock(int blockAddress)
    Retrieves the data block at the specified block address.
    byte[]
    getBlocks(int fromBlockAddress, int toBlockAddress)
    Retrieves the data blocks within the specified range from the memory image of the storage card.
    Returns the product type of the storage card.
    byte[]
    Retrieves the system block from the storage card when available.
    byte[]
    Retrieves the unique identifier (UID) of the storage card.

    Methods inherited from interface org.eclipse.keypop.reader.selection.spi.SmartCard

    getPowerOnData
  • Method Details

    • getProductType

      ProductType getProductType()
      Returns the product type of the storage card.
      Returns:
      The product type of the storage card.
      Since:
      1.0.0
    • getUID

      byte[] getUID()
      Retrieves the unique identifier (UID) of the storage card.
      Returns:
      A byte array representing the UID of the storage card.
    • getSystemBlock

      byte[] getSystemBlock()
      Retrieves the system block from the storage card when available.

      The system block contains card-specific metadata and configuration data such as access control settings. Not all storage card types provide access to system blocks.

      The system block must have been previously read using a the {StorageCardTransactionManager.prepareReadSystemBlock()) method.

      Returns:
      The system block data as a byte array, or null if the system block has not been read yet.
      Throws:
      UnsupportedOperationException - If the current card type does not support system block access.
      Since:
      1.0.0
    • getBlock

      byte[] getBlock(int blockAddress)
      Retrieves the data block at the specified block address.

      If the block has not been previously read and stored in memory, the returned byte array will be filled with zeros.

      Parameters:
      blockAddress - The address of the block to retrieve
      Returns:
      The data block as a byte array, or a zero-filled byte array if the block has not been read yet.
      Throws:
      IndexOutOfBoundsException - If the block address is out of range.
      Since:
      1.0.0
    • getBlocks

      byte[] getBlocks(int fromBlockAddress, int toBlockAddress)
      Retrieves the data blocks within the specified range from the memory image of the storage card.

      The returned array contains the blocks in order, from fromBlockAddress to toBlockAddress. If a block has not been previously read and stored in memory, its corresponding bytes in the returned array will be filled with zeros.

      Parameters:
      fromBlockAddress - The starting block address (inclusive).
      toBlockAddress - The ending block address (inclusive).
      Returns:
      A byte array containing the data blocks within the specified range. Unread blocks are represented as zero-filled sections in the returned array.
      Throws:
      IndexOutOfBoundsException - If fromBlockAddress is greater than toBlockAddress, if either block address is negative, or if they exceed the available range of the memory image.