FileDocCategorySizeDatePackage
DODF.javaAPI DocphoneME MR2 API (J2ME)5424Wed May 02 18:00:38 BST 2007com.sun.satsa.util.pkcs15

DODF

public class DODF extends PKCS15File
This class represents the PKCS15 DODF file.
It is assumed that the DODF file has the following content:
opaqueDO: 
externalIDO: 0x80  
oidDO: 0xA1 
TLV.CONSTRUCTED+TLV.SEQUENCE_TYPE 
TLV.OID_TYPE
TLV.OCTETSTR_TYPE or something else

Fields Summary
public static final int
DODFTAG_OPAQUEDO
opaqueDO DODF entry tag.
public static final int
DODFTAG_EXTIDO
externalIDO DODF entry tag.
public static final int
DODFTAG_OIDDO
oidDO DODF entry tag.
private Vector
DODF
This vector contains parsed objects from DODF.
private TLV
typeTLV
Staff variable used in the readDODF function
private TLV
oidTLV
Staff variable used for the OidDo object store
private TLV
valueTLV
Staff variable used for the ExtIDo object store
private Vector
OidDo
This vector contains parsed OidDo objects from DODF.
private Vector
ExtIDo
This vector contains parsed ExtIDo objects from DODF.
private Vector
OpaqueDo
This vector contains parsed OpaqueDo objects from DODF.
Constructors Summary
public DODF(Location location, FileSystemAbstract files)
Creates DODF object for the pointed location and file system

param
location Location required location
param
files FileSystemAbstract requred file system


                              
         
        super(location, files);
    
Methods Summary
public byte[]getOid(int index)
Returns OID of the pointed OidDo object

param
index int index of the OidDo object
return
byte[] OID

        return ((TLV)OidDo.elementAt(index)).getValue();
    
public intgetOidDoNumber()
Returns the number of the OidDo objects in the DODF file

return
int number

        return OidDo.size();
    
public TLVgetOidDoValueTLV(int index)
Returns value of the pointed OidDo object

param
index int index of the OidDo object
return
TLV contained the required object

        return ((TLV)OidDo.elementAt(index)).next.child;
    
public voidload()
Loads DODF object from the file system

throws
IOException if I/O error occurs
throws
TLVException if TLV error occurs

        DODF = new Vector();
        resetLoader(DODF, null, null);
        parseDF(location.path);
        readDODF();
    
private voidreadDODF()
Reads DODF data from the DODF vector.
The DODF file contains information about DO files in the following
format:
CONTEXT_CONSTRUCTED_0 { the ExternalIDO

}
CONTEXT_CONSTRUCTED_1 { the oidDO
OID_TYPE Object ID

}
}
}

        TLV typeTLV = (TLV) DODF.firstElement();

        while (typeTLV != null) {
            switch (typeTLV.type) {
                case DODFTAG_EXTIDO: {
                    valueTLV = typeTLV;
                    ExtIDo.addElement(valueTLV);
                    break;
                }
                case DODFTAG_OIDDO: {
                    oidTLV = typeTLV.child.next.next.child.child;
                    OidDo.addElement(oidTLV);
                    break;
                }
                default: {
                    OpaqueDo.addElement(typeTLV);
                    break;
                }
            }
            typeTLV = typeTLV.next;
        }