Interface FileSystemCardService

  • All Superinterfaces:
    CardServiceInterface, FileAccessCardService, SecureService
    All Known Subinterfaces:
    IsoFileSystemCardService
    All Known Implementing Classes:
    IsoCardService, SmartCardHSMCardService

    public interface FileSystemCardService
    extends FileAccessCardService
    Interface defining creational methods for file system based smartcards. Creational methods are methods that support file creation, deletion, and invalidation. These methods are extensions to the file access methods specified in ISO 7816-4. A card service has to implement these methods in order to support the corresponding methods in class CardFile.
    For the CardFilePath arguments in the methods defined here, the restrictions described in FileAccessCardService apply, too.
    Author:
    Dirk Husemann (hud@zurich.ibm.com), Reto Hermann (rhe@zurich.ibm.com), Roland Weber (rolweber@de.ibm.com)
    See Also:
    CardFile, FileAccessCardService
    • Method Detail

      • create

        void create​(CardFilePath parent,
                    byte[] data)
             throws CardServiceException,
                    CardTerminalException
        Creates a file on the smartcard. Creating files is a card-specific operation. While the ISO file types are specified, the access conditions that can be defined are not. When creating a file, the access conditions to the new file have to be given. The result is that no card-independent arguments to a create method can be specified.
        This method defines only a card-neutral signature by expecting a byte array as a parameter. The data to be stored in that byte array is card-specific. It is suggested, but not required, that a file header, as it is returned by CardFileInfo.getHeader, is accepted as that parameter block. A file header typically holds all information needed for creating a file, in a card-specific encoding. This information includes the file ID, structure, size, and the access conditions.

        This method is intended to be used in a scenario where new applications have to be downloaded on a smartcard. Typically, a server will be contacted to retrieve the information about the directories and files that have to be created. This server can be supplied with the card's ATR, which is encapsulated by class CardID. The server will then be able to send parameter blocks that are appropriate arguments for this method and the respective card.

        Parameters:
        parent - the path to the directory in which to create a new file
        data - the parameters specifying the file to create. This argument is card-specific. Refer to the documentation of the card-specific service for details.
        Throws:
        CardServiceException - if the service encountered an error
        CardTerminalException - if the terminal encountered an error
        See Also:
        FileAccessCardService.getFileInfo(opencard.opt.iso.fs.CardFilePath), CardFileInfo.getHeader(), CardID, SmartCard.getCardID()
      • delete

        void delete​(CardFilePath file)
             throws CardServiceException,
                    CardTerminalException
        Deletes a file on the smartcard. Deleting a file completely removes it from the smartcard. The associated resources on the card, that is the allocated memory, will be freed. It is not possible to restore the file. A new file with the same id as the deleted file may be created in the same directory (DF).
        Parameters:
        file - the path to the file to delete
        Throws:
        CardServiceException - if the service encountered an error
        CardTerminalException - if the terminal encountered an error
      • invalidate

        void invalidate​(CardFilePath file)
                 throws CardServiceInabilityException,
                        CardServiceException,
                        CardTerminalException
        Invalidates a file on the smartcard. Invalidating a file makes it inaccessible, but leaves it on the card. The associated resources of the file are not freed. It is not possible to create a new file with the same id in the same directory (DF). It may be possible to reverse the invalidation by invoking rehabilitate.
        Since a card service may implement this interface to provide create and delete access only, a CardServiceInabilityException may be thrown if invalidation is not supported.

        This method should not be implemented by setting all access conditions of the file to NEVER. Files with access condition NEVER are often used for internal purposes, for example to hold keys or application specific executable code. Invalidating a file should make the card OS ignore the file's contents.

        Parameters:
        file - the path to the file to invalidate
        Throws:
        CardServiceInabilityException - if the service does not support this operation
        CardServiceException - if the service encountered an error
        CardTerminalException - if the terminal encountered an error