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

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.TcPolicy
All Implemented Interfaces:
TcIAttributes, TcIPolicy, TcIWorkingObject

public class TcPolicy
extends TcWorkingObject
implements TcIPolicy


Method Summary
 void assignToObject(TcIAuthObject obj)
          This method assigns an object (working object) like TPM object, key object, encrypted data object to a certain policy.
 void flushSecret()
          This method flushes a cached secret.
 TcBlobData getAttribCallback(long subFlag)
          Not yet supported.
 long getAttribCallbackUINT32(long subFlag)
          The sole purpose of this method is to notify callers that TSS 1.1 style callback functions are not supported.
 TcBlobData getAttribDelegationInfo(long subFlag)
          Not yet supported.
 long getAttribDelegationInfoUINT32(long subFlag)
          Not yet supported.
 TcBlobData getAttribDelegationPcr(long subFlag)
          Not yet supported.
 long getAttribDelegationPcrUINT32(long subFlag)
          Not yet supported.
 TcBlobData getAttribPopupString(long subFlag)
          This method is a shortcut for calling TcIAttributes.getAttribData(long, long) with TcTssConstants.TSS_TSPATTRIB_POLICY_POPUPSTRING as flag.
 long getAttribSecretHashMode(long subFlag)
          This method is a shortcut for calling TcIAttributes.setAttribUint32(long, long, long) with TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE as flag.
 long getAttribSecretLifetime(long subFlag)
          This method is a shortcut for calling TcIAttributes.getAttribUint32(long, long) with TcTssConstants.TSS_TSPATTRIB_POLICY_SECRET_LIFETIME as flag.
 long getPolicyType()
          This methode is needed for returning the current policytype.
 boolean isSecretSet()
          Returns the state of the secret, without trying to get it from the user or by callback.
 void setAttribCallback(long subFlag, TcBlobData attrib)
          Not yet supported.
 void setAttribCallbackUINT32(long subFlag, long attrib)
          The sole purpose of this method is to notify callers that TSS 1.1 style callback functions are not supported.
 void setAttribDelegationInfo(long subFlag, TcBlobData attrib)
          Not yet supported.
 void setAttribDelegationInfoUINT32(long subFlag, long attrib)
          Not yet supported.
 void setAttribDelegationPcr(long subFlag, TcBlobData attrib)
          Not yet supported.
 void setAttribDelegationPcrUINT32(long subFlag, long attrib)
          Not yet supported.
 void setAttribPopupString(long subFlag, TcBlobData attrib)
          This method is a shortcut for calling TcIAttributes.setAttribData(long, long, TcBlobData) with TcTssConstants.TSS_TSPATTRIB_POLICY_POPUPSTRING as flag.
 void setAttribSecretHashMode(long subFlag, long attrib)
          This method is a shortcut for calling TcIAttributes.setAttribUint32(long, long, long) with TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE as flag.
 void setAttribSecretLifetime(long subFlag, long attrib)
          This method is a shortcut for calling TcIAttributes.setAttribUint32(long, long, long) with TcTssConstants.TSS_TSPATTRIB_POLICY_SECRET_LIFETIME as flag.
 void setSecret(long secretMode, TcBlobData secret)
          This method sets the authorization data of a policy object and defines the handling of its retrieval.
 
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
 

Method Detail

assignToObject

public void assignToObject(TcIAuthObject obj)
                    throws TcTssException
Description copied from interface: TcIPolicy
This method assigns an object (working object) like TPM object, key object, encrypted data object to a certain policy. Each of these working objects will utilize its assigned policy object to process an authorized TPM command. Note that there are two different policies that can be assigned to a working object, usage policy and migration policy. The type of a policy object is determined upon creation of the policy object or later using the TcIAttributes.setAttribData(long, long, TcBlobData).

Specified by:
assignToObject in interface TcIPolicy
Parameters:
obj - The object to be assigned.
Throws:
TcTssException

flushSecret

public void flushSecret()
                 throws TcTssException
Description copied from interface: TcIPolicy
This method flushes a cached secret.

Specified by:
flushSecret in interface TcIPolicy
Throws:
TcTssException

setSecret

public void setSecret(long secretMode,
                      TcBlobData secret)
               throws TcTssException
Description copied from interface: TcIPolicy
This method sets the authorization data of a policy object and defines the handling of its retrieval.

Specified by:
setSecret in interface TcIPolicy
Parameters:
secretMode - Flag indicating the policy secret mode to set. Secret mode values are prefixed with TSS_SECRET_MODE_ and are defined in TcTssConstants.
Valid secretModes are: Note that there is another secret mode (TcTssConstants.TSS_SECRET_MODE_CALLBACK). To actually use the callback functionality to obtain the secret, the setAttribData method has to be used to set the callback. If this is done, the setSecret method must not be called.
secret - The secret data blob.
Throws:
TcTssException

setAttribCallbackUINT32

public void setAttribCallbackUINT32(long subFlag,
                                    long attrib)
                             throws TcTssException
The sole purpose of this method is to notify callers that TSS 1.1 style callback functions are not supported.

Throws:
TcTssException

getAttribCallbackUINT32

public long getAttribCallbackUINT32(long subFlag)
                             throws TcTssException
The sole purpose of this method is to notify callers that TSS 1.1 style callback functions are not supported.

Throws:
TcTssException

setAttribCallback

public void setAttribCallback(long subFlag,
                              TcBlobData attrib)
                       throws TcTssException
Not yet supported.

Throws:
TcTssException

getAttribCallback

public TcBlobData getAttribCallback(long subFlag)
                             throws TcTssException
Not yet supported.

Throws:
TcTssException

setAttribDelegationPcrUINT32

public void setAttribDelegationPcrUINT32(long subFlag,
                                         long attrib)
                                  throws TcTssException
Not yet supported.

Throws:
TcTssException

getAttribDelegationPcrUINT32

public long getAttribDelegationPcrUINT32(long subFlag)
                                  throws TcTssException
Not yet supported.

Throws:
TcTssException

setAttribDelegationPcr

public void setAttribDelegationPcr(long subFlag,
                                   TcBlobData attrib)
                            throws TcTssException
Not yet supported.

Throws:
TcTssException

getAttribDelegationPcr

public TcBlobData getAttribDelegationPcr(long subFlag)
                                  throws TcTssException
Not yet supported.

Throws:
TcTssException

setAttribDelegationInfoUINT32

public void setAttribDelegationInfoUINT32(long subFlag,
                                          long attrib)
                                   throws TcTssException
Not yet supported.

Throws:
TcTssException

getAttribDelegationInfoUINT32

public long getAttribDelegationInfoUINT32(long subFlag)
                                   throws TcTssException
Not yet supported.

Throws:
TcTssException

setAttribDelegationInfo

public void setAttribDelegationInfo(long subFlag,
                                    TcBlobData attrib)
                             throws TcTssException
Not yet supported.

Throws:
TcTssException

getAttribDelegationInfo

public TcBlobData getAttribDelegationInfo(long subFlag)
                                   throws TcTssException
Not yet supported.

Throws:
TcTssException

setAttribSecretLifetime

public void setAttribSecretLifetime(long subFlag,
                                    long attrib)
                             throws TcTssException
This method is a shortcut for calling TcIAttributes.setAttribUint32(long, long, long) with TcTssConstants.TSS_TSPATTRIB_POLICY_SECRET_LIFETIME as flag.

Parameters:
subFlag - Valid subFlags are: TcTssConstants.TSS_TSPATTRIB_POLICYSECRET_LIFETIME_ALWAYS, TcTssConstants.TSS_TSPATTRIB_POLICYSECRET_LIFETIME_COUNTER and TcTssConstants.TSS_TSPATTRIB_POLICYSECRET_LIFETIME_TIMER.
attrib - The lifetime value to set.
Throws:
{@link - TcTssException}
TcTssException

getAttribSecretLifetime

public long getAttribSecretLifetime(long subFlag)
                             throws TcTssException
This method is a shortcut for calling TcIAttributes.getAttribUint32(long, long) with TcTssConstants.TSS_TSPATTRIB_POLICY_SECRET_LIFETIME as flag.

Parameters:
subFlag - Valid subFlags are: TcTssConstants.TSS_TSPATTRIB_POLICYSECRET_LIFETIME_ALWAYS, TcTssConstants.TSS_TSPATTRIB_POLICYSECRET_LIFETIME_COUNTER and TcTssConstants.TSS_TSPATTRIB_POLICYSECRET_LIFETIME_TIMER.
Returns:
Current secret lifetime.
Throws:
{@link - TcTssException}
TcTssException

setAttribSecretHashMode

public void setAttribSecretHashMode(long subFlag,
                                    long attrib)
                             throws TcTssException
This method is a shortcut for calling TcIAttributes.setAttribUint32(long, long, long) with TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE as flag.

Parameters:
subFlag - Valid subFlags are: TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE_POPUP
attrib - The hash mode to set.
Throws:
{@link - TcTssException}
TcTssException

getAttribSecretHashMode

public long getAttribSecretHashMode(long subFlag)
                             throws TcTssException
This method is a shortcut for calling TcIAttributes.setAttribUint32(long, long, long) with TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE as flag.

Parameters:
subFlag - Valid subFlags are: TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE_POPUP.
Returns:
Current hash mode.
Throws:
{@link - TcTssException}
TcTssException

setAttribPopupString

public void setAttribPopupString(long subFlag,
                                 TcBlobData attrib)
                          throws TcTssException
This method is a shortcut for calling TcIAttributes.setAttribData(long, long, TcBlobData) with TcTssConstants.TSS_TSPATTRIB_POLICY_POPUPSTRING as flag.

Parameters:
subFlag - Ignored.
attrib - Popup string.
Throws:
{@link - TcTssException}
TcTssException

getAttribPopupString

public TcBlobData getAttribPopupString(long subFlag)
                                throws TcTssException
This method is a shortcut for calling TcIAttributes.getAttribData(long, long) with TcTssConstants.TSS_TSPATTRIB_POLICY_POPUPSTRING as flag.

Parameters:
subFlag - Ignored.
Returns:
Current popup string.
Throws:
{@link - TcTssException}
TcTssException

isSecretSet

public boolean isSecretSet()
Returns the state of the secret, without trying to get it from the user or by callback.


getPolicyType

public long getPolicyType()
This methode is needed for returning the current policytype.

Returns:
the policytype