| ePass1000 C/C++ API Reference Manual Version 2.0 |
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;
| 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. |
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. |
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. |
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.
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. |
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. |
| 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. |
EPAS_ACCESSINFO, EPAS_VERSIONINFO, EPAS_SYSINFO, EPAS_DIRINFO