public HashTPMBlobWritableDataProvider(ITPMBlobWritable blobWritable) { TPMBlob tempBlob = new TPMBlob (); blobWritable.WriteToTpmBlob (tempBlob); _subDataProvider = new HashStreamDataProvider (tempBlob, null, null, true); }
public HashTPMBlobWritableDataProvider(ITPMBlobWritable blobWritable) { TPMBlob tempBlob = new TPMBlob(); blobWritable.WriteToTpmBlob(tempBlob); _subDataProvider = new HashStreamDataProvider(tempBlob, null, null, true); }
/// <summary> /// Writes target to sink with the uint size preceding /// </summary> /// <param name="sink"></param> /// <param name="target"></param> public static void WriteITPMBlobWritableWithUIntSize(TPMBlob sink, ITPMBlobWritable target) { if (target == null) { sink.WriteUInt32(0); } else { using (TPMBlob tempBlob = new TPMBlob()) { target.WriteToTpmBlob(tempBlob); sink.WriteUInt32((uint)tempBlob.Length); sink.Write(tempBlob.ToArray(), 0, (int)tempBlob.Length); } } }
/// <summary> /// Writes target to sink with the uint size preceding /// </summary> /// <param name="sink"></param> /// <param name="target"></param> public static void WriteITPMBlobWritableWithUIntSize(TPMBlob sink, ITPMBlobWritable target) { if (target == null) { sink.WriteUInt32 (0); } else { using (TPMBlob tempBlob = new TPMBlob ()) { target.WriteToTpmBlob (tempBlob); sink.WriteUInt32 ((uint)tempBlob.Length); sink.Write (tempBlob.ToArray (), 0, (int)tempBlob.Length); } } }