ePass1000 C/C++ API Reference Manual Version 2.0

# EPAS_FILEINFO

The EPAS_FILEINFO structure defines system information of the ePass1000. It is used to obtain or modify information of an file or directory in the token.

    typedef struct{
        unsigned long ulID;
        unsigned long ulFlags;
        unsigned long ulFileSize;
        unsigned char ucFileType;
        unsigned char ucReadAccess;
        unsigned char ucWriteAccess;
        unsigned char ucCryptAccess;
        unsigned char ucReserved1[12];
        unsigned char ucGrantedAccess;
        unsigned char ucReserved2[15];
    }EPAS_FILEINFO,*PEPAS_FILEINFO;

#### Member

ulID
  This member defines the ID of the file. For file system of EPAS_SYS_TYPE1, file IDs are 32-bit in the range of 0 to 0xFFFFFFFF or 16-bit in the range of 0 to 0xEFFF. Application should use only 16-bit file id. Future version of the file system will only support 16-bit file IDs.
ulFlags
  This member is reserved for future use and must be set to zero.
ulFileSize
  The member defines the size of the file. For file system of EPAS_SYS_TYPE1, if the ucFileType member is EPAS_FILETYPE_UNUSED, then this member defines the amount of total free space of the device. It is recommended that application do not depend on this mechanism since it may not be supported on future version of the file system.
ucFileType
  This member can be one of the following value:

  Type | Description
  --- | ---
  EPAS_FILETYPE_DATA | Any variable length binary data.
  EPAS_FILETYPE_KEY | Binary data that is used as input to cryptographic operations
  EPAS_FILETYPE_DIR | Defines a directory
  EPAS_FILETYPE_UNUSED | Free space file. Size of this file equal to total free space of the device.
  EPAS_FILETYPE_UNKNOWN | Unknown type of file.

ucReadAccess
  This member defines the read access privilege for the file. Read access can be one of the following value:

  For EPAS_FILETYPE_DATA:

  Type | Description
  --- | ---
  EPAS_ACCESS_ANYONE | Application can always achieve read access to the file. Security State of the device is ignored.
  EPAS_ACCESS_NONE | Application can never achieve read access to the file. Security State of the device is ignored.
  EPAS_ACCESS_USER | Application can read file in User State or SO State.
  EPAS_ACCESS_OFFICER | Application can read file in SO State.

  For EPAS_FILETYPE_KEY:

  Type | Description
  --- | ---
  EPAS_ACCESS_NONE | Application can never achieve read access to the file. Security State of the device is ignored.

  ucReadAccess does NOT apply for EPAS_FILETYPE_DIR, EPAS_FILETYPE_UNUSED and EPAS_FILETYPE_UNKNOWN.
ucWriteAccess
  This member defines the write access privilege for the file. Write access can be one of the following value:

  For EPAS_FILETYPE_DATA, EPAS_FILETYPE_KEY:

  Type | Description
  --- | ---
  EPAS_ACCESS_ANYONE | Application can always achieve write access to the file. Security State of the device is ignored.
  EPAS_ACCESS_NONE | Application can never achieve write access to the file. Security State of the device is ignored.
  EPAS_ACCESS_USER | Application can write file in User State or SO State.
  EPAS_ACCESS_OFFICER | Application can write file in SO State.

  ucWriteAccess does not apply for the following file type: EPAS_FILETYPE_DIR, EPAS_FILETYPE_UNUSED and EPAS_FILETYPE_UNKNOWN.
ucCryptAccess
  This member defines the cryptographic access for the file. Cryptographic accesses can be one of the following value for each file type:

  For EPAS_FILETYPE_DATA:

  Type | Description
  --- | ---
  EPAS_ACCESS_NONE | Cryptographic operations are always allowed to be performed on the file. Security State of the file is ignored.

  For EPAS_FILETYPE_KEY:

  Type | Description
  --- | ---
  EPAS_ACCESS_ANYONE | Cryptographic operations are always allowed to be performed on the file. Security State of the file is ignored.
  EPAS_ACCESS_NONE | Cryptographic operations are never allowed to be performed on the file. Security State of the file is ignored.
  EPAS_ACCESS_USER | Application can perform crypt operations on the file in User State or SO State.
  EPAS_ACCESS_OFFICER | Application can perform crypt operations on the file in SO State.

  ucCryptAccess does not apply for the following file types: EPAS_FILETYPE_DIR, EPAS_FILETYPE_UNUSED and EPAS_FILETYPE_UNKNOWN.

ucReserved1
  This member is reserved for future use and must be set to zero.
ucGrantedAccess

  This member defines a bit mask of the current granted access privilege for the file:

  Access | Description
  --- | ---
  EPAS_ACCESS_READ | Read access to the file has been granted.
  EPAS_ACCESS_WRITE | Write access to the file has been granted.
  EPAS_ACCESS_CRYPT | Cryptographic access to the file has been granted.

ucReserved2
  This member is reserved for future use and must be set to zero.

#### Remarks

It is recommended that applications use only 16-bit file IDs other then use 32-bit file IDs. 32-bit file IDs may not be supported on future versions of the file systems.

To obtain file system information of a device, use the epas_GetProperty functions.

Application should zero initialize this structure before invoke any functions.

The following file IDs have been defined by Feitian:

File IDs | Description
--- | ---
0xF000 to 0xFFFF | These file IDs are reserved by Feitian
0x0000 to 0xEFFF | Application should use file IDs within this range.

The following file IDs are used by Feitian, and are located in the root directory (Master File):

Name | Value | Description
--- | --- | ---
EPAS_INDEX_FILE | 0xFFFF | Token Application Directory (TAD) index file.
EPAS_TOKEN_NAME_SIZE | 0xFFFE | Contains the friendly name of the token.

#### See Also

EPAS_ACCESSINFO, EPAS_VERSIONINFO, EPAS_SYSINFO, EPAS_DIRINFO