PKCS15Filepublic class PKCS15File extends Object This class represents PKCS15 file abstraction |
Fields Summary |
---|
protected static final short | ODFPathODF path. | protected static final short | TokenInfoPathEF(TokenInfo) path. | protected static final short | UnusedSpaceEF(UnusedSpace) path. | protected Vector | loaderObjectsThis vector contains objects loaded from directory file. | protected Vector | loaderLocationsThis vector contains locations of loaded objects. | protected Vector | loaderFreeBlocksThis vector contains locations of free space in directory
files. | protected Location | locationLocation | protected FileSystemAbstract | filesFile system object. |
Constructors Summary |
---|
protected PKCS15File(Location location, FileSystemAbstract files)Create the object for the pointed file system and location
this.location = location;
this.files = files;
| protected PKCS15File(FileSystemAbstract files)Create the object for the pointed file system
this.files = files;
|
Methods Summary |
---|
protected static void | doParseDF(byte[] data, short[] path, java.util.Vector objects, java.util.Vector locations, java.util.Vector freeBlocks)Parses EF(DF).
int start = 0;
int current = 0;
while (current < data.length) {
// free space - skip
if (data[current] == (byte) 0xff) {
current++;
continue;
}
// TLV object
TLV t = new TLV(data, current);
// empty one - skip
if (t.type == 0) {
current = t.valueOffset + t.length;
continue;
}
// real object
if (objects != null) {
objects.addElement(t);
}
if (locations != null) {
locations.addElement(new Location(path, current,
t.valueOffset + t.length - current));
}
if (freeBlocks != null && start < current) {
freeBlocks.addElement(
new Location(path, start, current - start));
}
current = t.valueOffset + t.length;
start = current;
}
if (start < current && freeBlocks != null) {
freeBlocks.addElement(
new Location(path, start, current - start));
}
| protected void | parseDF(short[] path)Parses directory file. Places results into vectors specified
resetLoader method.
if (path.length > 1) {
files.select(path);
} else {
files.select(path[0]);
}
doParseDF(files.readFile(), path,
loaderObjects, loaderLocations, loaderFreeBlocks);
| protected void | resetLoader(java.util.Vector objects, java.util.Vector locations, java.util.Vector freeBlocks)Initialises object loader.
loaderObjects = objects;
loaderLocations = locations;
loaderFreeBlocks = freeBlocks;
|
|