iaik.tc.tss.api.structs.common
Class TcCompositeTypeDecoder

java.lang.Object
  extended by iaik.tc.tss.api.structs.common.TcBasicTypeDecoder
      extended by iaik.tc.tss.api.structs.common.TcCompositeTypeDecoder
Direct Known Subclasses:
TcTcgFullCert, TcTcgPcclientStoredCert, TcTcsAuth, TcTcsLoadkeyInfo, TcTpmAsymCaContents, TcTpmAuditEventIn, TcTpmAuditEventOut, TcTpmAuthdata, TcTpmBoundData, TcTpmCapVersionInfo, TcTpmCertifyInfo, TcTpmCertifyInfo2, TcTpmChangeauthValidate, TcTpmCmkAuth, TcTpmCmkMaApproval, TcTpmCmkMigauth, TcTpmCmkSigticket, TcTpmContextBlob, TcTpmContextSensitive, TcTpmCounterValue, TcTpmCurrentTicks, TcTpmDaaBlob, TcTpmDaaContext, TcTpmDaaIssuer, TcTpmDaaJoindata, TcTpmDaaSensitive, TcTpmDaaTpm, TcTpmDelegateKeyBlob, TcTpmDelegateLabel, TcTpmDelegateOwnerBlob, TcTpmDelegatePublic, TcTpmDelegateSensitive, TcTpmDelegateTableRow, TcTpmDelegations, TcTpmDigest, TcTpmEkBlob, TcTpmEkBlobActivate, TcTpmEkBlobAuth, TcTpmFamilyLabel, TcTpmFamilyTableEntry, TcTpmGenericReturnBlob, TcTpmIdentityContents, TcTpmIdentityProof, TcTpmIdentityReq, TcTpmKey, TcTpmKey12, TcTpmKeyHandleList, TcTpmKeyParms, TcTpmMigrateAsymkey, TcTpmMigrationkeyAuth, TcTpmMsaComposite, TcTpmNonce, TcTpmNvAttributes, TcTpmNvDataPublic, TcTpmPcrAttributes, TcTpmPcrComposite, TcTpmPcrInfo, TcTpmPcrInfoLong, TcTpmPcrInfoShort, TcTpmPcrSelection, TcTpmPermanentFlags, TcTpmPubkey, TcTpmQuoteInfo, TcTpmQuoteInfo2, TcTpmRsaKeyParms, TcTpmSealedData, TcTpmSelectSize, TcTpmSignInfo, TcTpmStAnyFlags, TcTpmStClearFlags, TcTpmStoreAsymkey, TcTpmStoredData, TcTpmStoredData12, TcTpmStorePrivkey, TcTpmStorePubkey, TcTpmSymCaAttestation, TcTpmSymmetricKey, TcTpmSymmetricKeyParms, TcTpmTransportAuth, TcTpmTransportInternal, TcTpmTransportLogIn, TcTpmTransportLogOut, TcTpmTransportPublic, TcTpmVersion

public abstract class TcCompositeTypeDecoder
extends TcBasicTypeDecoder

This class extends the basic type decoding class and adds functionality to handle composite types such as TPM_KEY_PARMS. The individual elements of such structs are represented by the fields of the classes that inherit from TcCompositeTypeDecoder. In addition to decoding composite types, this class also supports the construction encoding as raw byte blob of composite types. By using the set methods of the child classes, the elements can be filled with their desired values. Subsequently, the getEncoded method returns a byte blob representing the structures contents. This blob can then be handed to lower layers (TSS).


Constructor Summary
TcCompositeTypeDecoder()
          Default Constructor.
TcCompositeTypeDecoder(TcBlobData data)
          This constructor takes a byte data object to be decoded.
TcCompositeTypeDecoder(TcBlobData data, int offset)
          This constructor takes a byte data object to be decoded.
TcCompositeTypeDecoder(TcCompositeTypeDecoder composite)
          This constructor takes another composite type object as argument.
 
Method Summary
abstract  TcBlobData getEncoded()
          This method returns the internal state of a type object as a byte blob.
 java.lang.String toString()
          For debugging purposes, the toString method can be useful to examine the inner state of composite type objects.
 
Methods inherited from class iaik.tc.tss.api.structs.common.TcBasicTypeDecoder
decodeBoolean, decodeByte, decodeBytes, decodeBytes, decodeTpmAlgorithmId, decodeTpmAuthDataUsage, decodeTpmEncScheme, decodeTpmKeyFlags, decodeTpmKeyUsage, decodeTpmSigScheme, decodeTssAlgorithmId, decodeTssEncScheme, decodeTssEvenType, decodeTssFlag, decodeTssHandle, decodeTssHContext, decodeTssHEncData, decodeTssHHash, decodeTssHKey, decodeTssHObjet, decodeTssHPcrs, decodeTssHPolicy, decodeTssHPS, decodeTssHTpm, decodeTssKeyUsageId, decodeTssMigrationScheme, decodeTssResult, decodeTssSigScheme, decodeUINT16, decodeUINT32, decodeUINT64
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TcCompositeTypeDecoder

public TcCompositeTypeDecoder()
Default Constructor. This constructor is used to create an empty instance. The field contents can then be assigned using the set-methods of the child class. Via the getEncoded method, a byte blob representation of the data can be obtained.


TcCompositeTypeDecoder

public TcCompositeTypeDecoder(TcBlobData data)
This constructor takes a byte data object to be decoded. The initial offset is set to 0.

Parameters:
data - The byte data to be decoded.

TcCompositeTypeDecoder

public TcCompositeTypeDecoder(TcBlobData data,
                              int offset)
This constructor takes a byte data object to be decoded. The initial offset is set to the specified one.

Parameters:
data - The byte data to be decoded.
offset - The initial offset.

TcCompositeTypeDecoder

public TcCompositeTypeDecoder(TcCompositeTypeDecoder composite)
This constructor takes another composite type object as argument. It is useful if a composite type contains fields that are not of a primitive type but of a composite type. To decode such a field, the outer structure crates an instance of the appropriate class and passes the this pointer to the constructor. The inner class can then obtain the raw data and the current offset from the outer structure. After decoding of the inner class is complete, the offset of the outer structure is advanced accordingly. The outer structure can then continue with decoding without the need to manually correct the current offset. This is illustrated e.g. in the TcTpmKey.decode method.

Parameters:
composite - outer structure this structure belongs to
Method Detail

toString

public java.lang.String toString()
For debugging purposes, the toString method can be useful to examine the inner state of composite type objects.

Overrides:
toString in class java.lang.Object

getEncoded

public abstract TcBlobData getEncoded()
This method returns the internal state of a type object as a byte blob. The fields a encoded in big endian byte order (MSB first). Byte packing is done at byte boundaries as specified in the TCG spec.

Returns:
byte blob to be passed to other layers (e.g. TSS)