iaik.tc.tss.impl.java.tsp
Class TcMonotonicCtr

java.lang.Object
  extended by iaik.tc.tss.impl.java.tsp.TcAttributes
      extended by iaik.tc.tss.impl.java.tsp.TcWorkingObject
          extended by iaik.tc.tss.impl.java.tsp.TcAuthObject
              extended by iaik.tc.tss.impl.java.tsp.TcMonotonicCtr
All Implemented Interfaces:
TcIAttributes, TcIAuthObject, TcIMonotonicCtr, TcIWorkingObject

public class TcMonotonicCtr
extends TcAuthObject
implements TcIMonotonicCtr

Author:
tpm

Method Summary
 void changeAuth(TcIAuthObject parentObject, TcIPolicy newPolicy)
          This method changes the authorization data (secret) of an entity (object) and assigns the object to the newPolicy object.
 java.lang.Object[] createCtr(TcBlobData label)
          This method creates the counter with the label provided.
 java.lang.Object incrementCtr()
          This method increments a previously defined counter.
 long readCtr()
          This method reads the counter value.
 void releaseCtr()
          This method releases the counter.
 
Methods inherited from class iaik.tc.tss.impl.java.tsp.TcAuthObject
changeAuthAsym, getPolicyObject, getUsagePolicyObject
 
Methods inherited from class iaik.tc.tss.impl.java.tsp.TcAttributes
getAttribData, getAttribUint32, setAttribData, setAttribUint32
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface iaik.tc.tss.api.tspi.TcIAttributes
getAttribData, getAttribUint32, setAttribData, setAttribUint32
 
Methods inherited from interface iaik.tc.tss.api.tspi.TcIAuthObject
changeAuthAsym, getPolicyObject, getUsagePolicyObject
 

Method Detail

releaseCtr

public void releaseCtr()
                throws TcTssException
This method releases the counter. Note that this command requires owner authorization which can be set via the usage policy of the TPM object.

Specified by:
releaseCtr in interface TcIMonotonicCtr
Throws:
TcTssException
TSS Spec. 1.2 Errata A, page number:
383

incrementCtr

public java.lang.Object incrementCtr()
                              throws TcTssException
This method increments a previously defined counter. A policy object must be assigned to this object; the authData within the policy object will be used to authorize this operation.

Specified by:
incrementCtr in interface TcIMonotonicCtr
Returns:
The new TcTpmCounterValue post increment
Throws:
TcTssException
TSS Spec. 1.2 Errata A, page number:
384

readCtr

public long readCtr()
             throws TcTssException
This method reads the counter value.

Specified by:
readCtr in interface TcIMonotonicCtr
Returns:
The current value of the counter
Throws:
TcTssException

createCtr

public java.lang.Object[] createCtr(TcBlobData label)
                             throws TcTssException
Description copied from interface: TcIMonotonicCtr
This method creates the counter with the label provided. Note that this command requires owner authorization which can be set via the usage policy of the TPM object.

Specified by:
createCtr in interface TcIMonotonicCtr
Parameters:
label - The label value used to identify this counter
Returns:
0 ... The handle for the counter (Long) 1 ... The starting counter value (TcTpmCounterValue)
Throws:
TcTssException

changeAuth

public void changeAuth(TcIAuthObject parentObject,
                       TcIPolicy newPolicy)
                throws TcTssException
Description copied from interface: TcIAuthObject
This method changes the authorization data (secret) of an entity (object) and assigns the object to the newPolicy object. All classes using secrets provide this method for changing their authorization data. To change the TPM owner authorization, this method has to be called on the TPM object. The parent has to be set to null. To change the SRK authorization, this method has to be called on the SRK key object and the parent has to be set to the TPM object.

Specified by:
changeAuth in interface TcIAuthObject
Parameters:
parentObject - The parent object wrapping this object.
newPolicy - Policy object providing the new authorization data.
Throws:
TcTssException