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

ODF

public class ODF extends PKCS15File
This class represents the PKCS15 ODF file

Fields Summary
public static final int
ODFTAG_PRIVATE_KEYS
PrivateKeys ODF entry tag.
public static final int
ODFTAG_PUBLIC_KEYS
PublicKeys ODF entry tag.
public static final int
ODFTAG_TRUSTED_PUBLIC_KEYS
PublicKeys ODF entry tag.
public static final int
ODFTAG_SECRET_KEYS
SecretKeys ODF entry tag.
public static final int
ODFTAG_CERTIFICATES
Certificates ODF entry tag.
public static final int
ODFTAG_TRUSTED_CERTIFICATES
Certificates ODF entry tag.
public static final int
ODFTAG_USEFUL_CERTIFICATES
Certificates ODF entry tag.
public static final int
ODFTAG_DATA_OBJECTS
DataObjects ODF entry tag.
public static final int
ODFTAG_AUTH_OBJECTS
AuthObjects ODF entry tag.
private Vector
pukdfPath
PublicKeys objects
private Vector
prkdfPath
PrivateKeys objects
private Vector
cdfPath
Certificates obiects
private Vector
skdfPath
SecretKeys objects
private Vector
aodfPath
AuthObjects objects
private Vector
dodfPath
DataObjects objects
private Vector
ODF
This vector contains parsed objects from DF(ODF).
Constructors Summary
public ODF(FileSystemAbstract files)
Creates the ODF object

param
files FileSystemAbstract file system that is used to reading from file


                         
       
        super(files);
    
Methods Summary
public intgetAODFCount()
Returns a number of the AODF files

return
int number of the AODF files

        return aodfPath.size();
    
public LocationgetAODFPath(int index)
returns location of the AODF file

param
index int number uf the AODF file
return
Location

        return ((Location)aodfPath.elementAt(index));
    
public java.util.VectorgetDOFs(byte[] tag)
Seeks the DODF file for the pointed tag

param
tag byte[] required tag
return
Vector the OidDo objects from the DODF file
throws
IOException any IO exceptions
throws
TLVException any TLV exceptions

        Vector v = new Vector();
        for (int i = 0; i < dodfPath.size(); i++) {
            DODF d = new DODF((Location)dodfPath.elementAt(i), files);
            d.load();
            for (int j = 0; j < d.getOidDoNumber(); j++) {
                if (Utils.byteMatch(tag, d.getOid(j))) {
                    v.addElement(d.getOidDoValueTLV(j));
                }
            }
        }
        return v;
    
public voidload()
Reads ODF .

throws
IOException if I/O error occurs
throws
TLVException if TLV error occurs It is supposed that the ODF file contains information in the following format: ODFTAG_xxx { Location } ... ODFTAG_xxx { Location }


        ODF = new Vector();
        resetLoader(ODF, null, null);
        parseDF(new short[] {ODFPath});

        for (int i = 0; i < ODF.size(); i++) {
            TLV t = (TLV) ODF.elementAt(i);
            Location l = files.pathToLocation(t.child.child);
            switch (t.type) {
                case ODFTAG_PRIVATE_KEYS: {
                    prkdfPath.addElement(l);
                    break;
                }
                case ODFTAG_PUBLIC_KEYS          :
                case ODFTAG_TRUSTED_PUBLIC_KEYS  : {
                    pukdfPath.addElement(l);
                    break;
                }
                case ODFTAG_SECRET_KEYS          : {
                    skdfPath.addElement(l);
                    break;
                }
                case ODFTAG_CERTIFICATES         :
                case ODFTAG_TRUSTED_CERTIFICATES :
                case ODFTAG_USEFUL_CERTIFICATES  : {
                    cdfPath.addElement(l);
                    break;
                }
                case ODFTAG_DATA_OBJECTS         : {
                    dodfPath.addElement(l);
                    break;
                }
                case ODFTAG_AUTH_OBJECTS         : {
                    aodfPath.addElement(l);
                    break;
                }

            }
        }