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

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.TcNvRam
All Implemented Interfaces:
TcIAttributes, TcIAuthObject, TcINvRam, TcIWorkingObject

public class TcNvRam
extends TcAuthObject
implements TcINvRam

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.
 void defineSpace(TcTpmNvDataPublic pubData)
          This method establishes the space necessary for the NV store.
 TcBlobData readValue(long offset, long dataLength)
          This method reads the data from the defined area.
 void releaseSpace()
          This method releases the space associated with the NV store instance.
 void writeValue(long offset, TcBlobData dataToWrite)
          This method writes a given value to a previously defined area.
 
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

defineSpace

public void defineSpace(TcTpmNvDataPublic pubData)
                 throws TcTssException
Description copied from interface: TcINvRam
This method establishes the space necessary for the NV store. Note that this command requires owner authorization which can be set via the usage policy of the TPM object.

Be careful when defining indices with set D-bit. Indices which have this bit set might be unerasable on some TPMs. Some TPM_NV_INDEX_* constants have this bit set for compatibility reasons.

Specified by:
defineSpace in interface TcINvRam
Parameters:
pubData - Complete TcTpmNvDataPublic object containing access information for the newly created NV storage area.
Throws:
TcTssException

readValue

public TcBlobData readValue(long offset,
                            long dataLength)
                     throws TcTssException
Description copied from interface: TcINvRam
This method reads the data from the defined area. If a policy object is assigned to this object, the authData within the policy object will be used to authorize this operation. If there is no policy object associated with this object, an unauthenticated write will be performed. If the data is larger than the TPM input buffer size, it needs to be read in chunks. *

Specified by:
readValue in interface TcINvRam
Parameters:
offset - The offset within the NV area to begin reading.
dataLength - The number of bytes to be read. The special value 0xFFFFFFFF activates Smart Read: the TSS will determine the size of data automatically and assemble it internally from its parts.
Returns:
The data read from the NV area.
Throws:
TcTssException

releaseSpace

public void releaseSpace()
                  throws TcTssException
Description copied from interface: TcINvRam
This method releases the space associated with the NV store instance. Note that this command requires owner authorization which can be set via the usage policy of the TPM object.

Specified by:
releaseSpace in interface TcINvRam
Throws:
TcTssException

writeValue

public void writeValue(long offset,
                       TcBlobData dataToWrite)
                throws TcTssException
Description copied from interface: TcINvRam
This method writes a given value to a previously defined area. If a policy object is assigned to this object, the authData within the policy object will be used to authorize this operation. If there is no policy object associated with this object, an unauthenticated write will be performed.

Specified by:
writeValue in interface TcINvRam
Parameters:
offset - The offset within the NV area to begin writing.
dataToWrite - The data to be written.
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