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

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.TcPcrCompositeBase
              extended by iaik.tc.tss.impl.java.tsp.TcPcrCompositeInfoLong
All Implemented Interfaces:
TcIAttributes, TcIPcrComposite, TcIWorkingObject

public class TcPcrCompositeInfoLong
extends TcPcrCompositeBase


Constructor Summary
TcPcrCompositeInfoLong(int numPCRs)
          For offline creation of struct
 
Method Summary
 TcBlobData getPcrCompositeHash()
          This method gets the digestAtRelease from the PCR composite object using a 1.2 TcTpmPcrInfoLong or TcTpmPcrInfoShort structure.
 long getPcrLocality()
          This method gets the LocalityAtRelease from the PCR composite object using a 1.2 TcTpmPcrInfoLong or TcTpmPcrInfoShort structure.
 void selectPcrIndex(long pcrIndex)
          This method selects a PCR index inside a PCR composite object using the 1.1 TcTpmPcrInfo structure.
 void selectPcrIndexEx(long pcrIndex, long direction)
          This method selects a PCR index inside a PCR composite object containing a TcTpmPcrInfoLong or TcTpmPcrInfoShort structure.
 void setPcrLocality(long localityValue)
          This method sets the LocalityAtRelease inside the PCR composite object using a 1.2 TcTpmPcrInfoLong or TcTpmPcrInfoShort structure.
 void setPcrValue(long pcrIndex, TcBlobData pcrValue)
          This method sets the digest for a given PCR index inside the PCR composite object.
An example for the usage is the preparation of a PCR composite object before calling TcIRsaKey.createKey(TcIRsaKey, TcIPcrComposite).
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class iaik.tc.tss.impl.java.tsp.TcPcrCompositeBase
getAttribPcrStruct, getPcrValue, setAttribPcrStruct
 
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, wait, wait, wait
 
Methods inherited from interface iaik.tc.tss.api.tspi.TcIAttributes
getAttribData, getAttribUint32, setAttribData, setAttribUint32
 

Constructor Detail

TcPcrCompositeInfoLong

public TcPcrCompositeInfoLong(int numPCRs)
                       throws TcTssException
For offline creation of struct

Parameters:
numPCRs -
Throws:
TcTssException
Method Detail

getPcrCompositeHash

public TcBlobData getPcrCompositeHash()
                               throws TcTssException,
                                      TcTcsException,
                                      TcTddlException,
                                      TcTpmException
Description copied from interface: TcIPcrComposite
This method gets the digestAtRelease from the PCR composite object using a 1.2 TcTpmPcrInfoLong or TcTpmPcrInfoShort structure. If the PcrComposite object is using a TcTpmPcrInfo (e.g. because the underlying TPM is a 1.1 TPM) a TcTssException with TcTssErrors.TSS_E_INVALID_OBJ_ACCESS error code is thrown.

Returns:
The digestAtRelease value.
Throws:
TcTssException
TcTcsException
TcTddlException
TcTpmException

getPcrLocality

public long getPcrLocality()
                    throws TcTssException
Description copied from interface: TcIPcrComposite
This method gets the LocalityAtRelease from the PCR composite object using a 1.2 TcTpmPcrInfoLong or TcTpmPcrInfoShort structure.

Returns:
The LocalityAtRelease value.
Throws:
TcTssException

selectPcrIndex

public void selectPcrIndex(long pcrIndex)
                    throws TcTssException
Description copied from interface: TcIPcrComposite
This method selects a PCR index inside a PCR composite object using the 1.1 TcTpmPcrInfo structure. If the PcrComposite object is using another structure than TcTpmPcrInfo, this function throws a TcTssException with an TcTssErrors.TSS_E_INVALID_OBJ_ACCESS error code.

Parameters:
pcrIndex - The index of the PCR to select.
Throws:
TcTssException

selectPcrIndexEx

public void selectPcrIndexEx(long pcrIndex,
                             long direction)
                      throws TcTssException
Description copied from interface: TcIPcrComposite
This method selects a PCR index inside a PCR composite object containing a TcTpmPcrInfoLong or TcTpmPcrInfoShort structure. For TcTpmPcrInfoLong, the index may be selected for creation or release; for TcTpmPcrInfoShort, the index may be selected only for release.
If the PcrComposite object is using a TcTpmPcrInfo (e.g. because the underlying TPM is a 1.1 TPM) a TcTssException with TcTssErrors.TSS_E_INVALID_OBJ_ACCESS error code is thrown.
If the PcrComposite object is using TcTpmPcrInfoShort and the direction indicates Creation, the method will throw a TcTssException with a TcTssErrors.TSS_E_INVALID_OBJ_ACCESS.

Parameters:
pcrIndex - The index of the PCR to select.
direction - Chooses whether the index selected is for a PCR at creation or a PCR at release. Valid direction flags are TcTssConstants.TSS_PCRS_DIRECTION_CREATION and TcTssConstants.TSS_PCRS_DIRECTION_RELEASE.
Throws:
TcTssException

setPcrLocality

public void setPcrLocality(long localityValue)
                    throws TcTssException
Description copied from interface: TcIPcrComposite
This method sets the LocalityAtRelease inside the PCR composite object using a 1.2 TcTpmPcrInfoLong or TcTpmPcrInfoShort structure. If the PcrComposite object is using a TcTpmPcrInfo (e.g. because the underlying TPM is a 1.1 TPM) a TcTssException with TcTssErrors.TSS_E_INVALID_OBJ_ACCESS error code is thrown.

Parameters:
localityValue - LocalityAtRelease value to set. Valid locality values are: TcTpmConstants.TPM_LOC_ZERO, TcTpmConstants.TPM_LOC_ONE, TcTpmConstants.TPM_LOC_TWO, TcTpmConstants.TPM_LOC_THREE, TcTpmConstants.TPM_LOC_FOUR.
Throws:
TcTssException

setPcrValue

public void setPcrValue(long pcrIndex,
                        TcBlobData pcrValue)
                 throws TcTssException
Description copied from interface: TcIPcrComposite
This method sets the digest for a given PCR index inside the PCR composite object.
An example for the usage is the preparation of a PCR composite object before calling TcIRsaKey.createKey(TcIRsaKey, TcIPcrComposite). Multiple PCRs with different indices can be set by calling this method multiple times in the same PCR composite object.
This method may be used to set PCR values in a PCR composite object regardless of the type of PCR structure (TcTpmPcrInfo, TcTpmPcrInfoShort or TcTpmPcrInfoLong) used by the object.
If a TcTpmPcrInfoLong is used, this method sets the PCR value for DigestAtRelease.

Parameters:
pcrIndex - The index of the PCR to set.
pcrValue - The value of the PCR.
Throws:
TcTssException

toString

public java.lang.String toString()
Description copied from class: TcPcrCompositeBase
Returns a string representation of the object.

Specified by:
toString in class TcPcrCompositeBase