Changeset 8

Show
Ignore:
Timestamp:
06/26/06 23:50:42 (4 years ago)
Author:
erik
Message:

Added some more javadocs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tpm4java/trunk/src/de/datenzone/tpm4java/TddlDeviceDriver.java

    r1 r8  
    2424 
    2525/** 
     26 * Generic Interface to describe the TPM chip. This is basically the 
     27 * DDL layer in our application. 
     28 *  
    2629 * @author martin 
    27  *  
    28  * Generic Interface to describe the TPM chip 
    2930 */ 
    3031public interface TddlDeviceDriver { 
     
    3839     */ 
    3940    public byte[] Tddli_TransmitData(byte[] cmd) throws IOException; 
     41     
     42    /** 
     43     * Request Status from the TPM. 
     44     *  
     45     * @param ReqStatusType 
     46     * @param puntStatus 
     47     * @return 
     48     */ 
    4049    public int Tddli_GetStatus(int ReqStatusType, int[] puntStatus); 
     50     
     51    /** 
     52     * Cancel the current request. 
     53     * @return The return code from the TPM. 
     54     */ 
    4155    public int Tddli_Cancel(); 
     56     
     57     
     58    /** 
     59     * Set the capabilities. 
     60     *  
     61     * @param CapArea 
     62     * @param SubCap 
     63     * @param pCapBuf 
     64     * @return 
     65     */ 
    4266    public int Tddli_SetCapability(int CapArea, int SubCap, int[] pCapBuf); 
     67     
     68    /** 
     69     * Get the capabilities. 
     70     *  
     71     * @param CapArea 
     72     * @param SubCap 
     73     * @param pCapBuf 
     74     * @return 
     75     */ 
    4376    public int Tddli_GetCapability(int CapArea, int SubCap, int[] pCapBuf); 
     77     
     78    /** 
     79     * Open a Connection to the TPM. 
     80     *  
     81     * @return The return code from the TPM. 
     82     */ 
    4483    public int Tddli_Open(); 
     84     
     85    /** 
     86     * Close the Connection to the TPM. 
     87     *  
     88     * @return The return code from the TPM. 
     89     */ 
    4590    public int Tddli_Close(); 
    4691} 
  • tpm4java/trunk/src/de/datenzone/tpm4java/TddlJniDeviceDriver.java

    r1 r8  
    2323import java.io.IOException; 
    2424 
     25/** 
     26 * A JNI version of a device driver. This is currently our 
     27 * default device driver for windows. 
     28 *  
     29 *  
     30 * @author Erik Tews 
     31 */ 
    2532public class TddlJniDeviceDriver implements TddlDeviceDriver { 
    2633 
     
    5057    private native int open(long fptr); 
    5158     
    52      
     59    /** 
     60     * Get a new deivce driver. 
     61     *  
     62     * @param name Name of the dll to use. Usually <b>TPMDDL.dll</b>. 
     63     */ 
    5364    protected TddlJniDeviceDriver(String name) { 
    5465        addr = new long[4]; 
     
    6677    } 
    6778     
    68          
    69         public byte[] Tddli_TransmitData(byte[] cmd) throws IOException { 
     79        /** 
     80     *  
     81     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_TransmitData(byte[]) 
     82         */ 
     83    public byte[] Tddli_TransmitData(byte[] cmd) throws IOException { 
    7084                byte[] result = new byte[16*1024]; 
    7185                transmitData(addr[1], cmd, cmd.length, result, result.length); 
     
    7387        } 
    7488 
     89    /** 
     90     *  
     91     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_GetStatus(int, int[]) 
     92     */ 
    7593        public int Tddli_GetStatus(int ReqStatusType, int[] puntStatus) { 
    7694                // TODO Auto-generated method stub 
     
    7896        } 
    7997 
     98    /** 
     99     *  
     100     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Cancel() 
     101     */ 
    80102        public int Tddli_Cancel() { 
    81103                // TODO Auto-generated method stub 
     
    83105        } 
    84106 
     107    /** 
     108     *  
     109     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_SetCapability(int, int, int[]) 
     110     */ 
    85111        public int Tddli_SetCapability(int CapArea, int SubCap, int[] pCapBuf) { 
    86112                // TODO Auto-generated method stub 
     
    88114        } 
    89115 
     116    /** 
     117     *  
     118     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_GetCapability(int, int, int[]) 
     119     */ 
    90120        public int Tddli_GetCapability(int CapArea, int SubCap, int[] pCapBuf) { 
    91121                // TODO Auto-generated method stub 
     
    93123        } 
    94124 
     125    /** 
     126     *  
     127     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Open() 
     128     */ 
    95129        public int Tddli_Open() { 
    96130                return open(addr[2]); 
     
    99133        private native int close(long fptr); 
    100134         
     135    /** 
     136     *  
     137     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Close() 
     138     */ 
    101139        public int Tddli_Close() { 
    102140                return close(addr[3]); 
    103141        } 
    104142 
     143     
    105144    protected void finalize() throws Throwable { 
    106145        super.finalize(); 
  • tpm4java/trunk/src/de/datenzone/tpm4java/TddlLinuxDeviceDriver.java

    r1 r8  
    7777    } 
    7878 
     79    /** 
     80     *  
     81     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_GetStatus(int, int[]) 
     82     */ 
    7983    public int Tddli_GetStatus(int ReqStatusType, int[] puntStatus) { 
    8084        // TODO Auto-generated method stub 
     
    8286    } 
    8387 
     88    /** 
     89     *  
     90     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Cancel() 
     91     */ 
    8492    public int Tddli_Cancel() { 
    8593        // TODO Auto-generated method stub 
     
    8795    } 
    8896 
     97    /** 
     98     *  
     99     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_SetCapability(int, int, int[]) 
     100     */ 
    89101    public int Tddli_SetCapability(int CapArea, int SubCap, int[] pCapBuf) { 
    90102        // TODO Auto-generated method stub 
     
    92104    } 
    93105 
     106    /** 
     107     *  
     108     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_GetCapability(int, int, int[]) 
     109     */ 
    94110    public int Tddli_GetCapability(int CapArea, int SubCap, int[] pCapBuf) { 
    95111        // TODO Auto-generated method stub 
     
    97113    } 
    98114 
     115    /** 
     116     *  
     117     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Open() 
     118     */ 
    99119    public int Tddli_Open() { 
    100120        try { 
     
    117137    } 
    118138 
     139    /** 
     140     *  
     141     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Close() 
     142     */ 
    119143    public int Tddli_Close() { 
    120144        /* 
  • tpm4java/trunk/src/de/datenzone/tpm4java/TddlSocketDriver.java

    r1 r8  
    2929 
    3030/** 
     31 * Access the TPM chip using a tcp server. 
     32 *  
    3133 * @author martin 
    32  *  
    33  * Access the TPM chip using a server file (eq. /dev/tpm in Linux) 
    3434 */ 
    3535public class TddlSocketDriver implements TddlDeviceDriver { 
     
    4646 
    4747    /** 
    48      * @param server 
    49      *            Name of the server file 
     48     * Create a new device driver. 
     49     *  
     50     * @param server Hostname of the server. 
     51     * @param port Portnumber, the server is listening on. 
    5052     * @throws IOException 
    5153     */ 
     
    8284    } 
    8385 
     86    /** 
     87     *  
     88     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_GetStatus(int, int[]) 
     89     */ 
    8490    public int Tddli_GetStatus(int ReqStatusType, int[] puntStatus) { 
    8591        // TODO Auto-generated method stub 
     
    8793    } 
    8894 
     95    /** 
     96     *  
     97     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Cancel() 
     98     */ 
    8999    public int Tddli_Cancel() { 
    90100        // TODO Auto-generated method stub 
     
    92102    } 
    93103 
     104    /** 
     105     *  
     106     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_SetCapability(int, int, int[]) 
     107     */ 
    94108    public int Tddli_SetCapability(int CapArea, int SubCap, int[] pCapBuf) { 
    95109        // TODO Auto-generated method stub 
     
    97111    } 
    98112 
     113    /** 
     114     *  
     115     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_GetCapability(int, int, int[]) 
     116     */ 
    99117    public int Tddli_GetCapability(int CapArea, int SubCap, int[] pCapBuf) { 
    100118        // TODO Auto-generated method stub 
     
    102120    } 
    103121 
     122    /** 
     123     *  
     124     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Open() 
     125     */ 
    104126    public int Tddli_Open() { 
    105127        try { 
     
    114136    } 
    115137 
     138    /** 
     139     *  
     140     * @see de.datenzone.tpm4java.TddlDeviceDriver#Tddli_Close() 
     141     */ 
    116142    public int Tddli_Close() { 
    117143        /* 
  • tpm4java/trunk/src/de/datenzone/tpm4java/TpmRandom.java

    r1 r8  
    2424import java.util.Random; 
    2525 
     26/** 
     27 * A Random replacement which uses the TPMs internal PRNG. 
     28 *  
     29 * This should provide really secure random numbers. 
     30 *  
     31 * @author Erik Tews 
     32 */ 
    2633public class TpmRandom extends Random { 
    2734    private static final long serialVersionUID = -3797005071234662617L; 
     
    4552    } 
    4653 
     54    /** 
     55     * @see java.util.Random#setSeed(long) 
     56     */ 
    4757    public synchronized void setSeed(long seed) { 
    4858        byte[] tmp = new byte[8]; 
  • tpm4java/trunk/src/de/datenzone/tpm4java/TssLowlevel.java

    r1 r8  
    3636import javax.crypto.NoSuchPaddingException; 
    3737 
     38/** 
     39 * A low level interface to a tpm chip. 
     40 *  
     41 * When you are going to do some more difficult things, you should 
     42 * prefer this over TssHighLevel. 
     43 *  
     44 * @author Erik Tews 
     45 */ 
    3846public interface TssLowlevel { 
    3947 
     48    /** 
     49     * IDs for all algorithms used by the TPM. 
     50     *  
     51     * @author Erik Tews 
     52     */ 
    4053    public interface AlgorithmId { 
    4154        public final static int TPM_ALG_RSA = 1; 
     
    5871    } 
    5972 
    60     // Constants for GetCapability: 
     73    /** 
     74     * Constants for GetCapability. 
     75     */ 
    6176    public interface Capabilities { 
    6277        // Queries whether a command is supported. 
     
    197212    } 
    198213 
     214    /** 
     215     * All entities the TPM knows. 
     216     *  
     217     * @author Erik Tews 
     218     */ 
    199219    public interface EntityType { 
    200220        public static final short TPM_ET_KEYHANDLE = 0x0001; 
     
    222242    } 
    223243 
     244    /** 
     245     * Keyhandles for the TPMs keystore. 
     246     *  
     247     * @author Erik Tews 
     248     */ 
    224249    public interface KeyHandle { 
    225250        public static final int TPM_KH_SRK = 0x40000000;