public HashTPMBlobWritableDataProvider(ITPMBlobWritable blobWritable)
        {
            TPMBlob tempBlob = new TPMBlob ();
            blobWritable.WriteToTpmBlob (tempBlob);

            _subDataProvider = new HashStreamDataProvider (tempBlob, null, null, true);
        }
Example #2
0
        public HashTPMBlobWritableDataProvider(ITPMBlobWritable blobWritable)
        {
            TPMBlob tempBlob = new TPMBlob();

            blobWritable.WriteToTpmBlob(tempBlob);

            _subDataProvider = new HashStreamDataProvider(tempBlob, null, null, true);
        }
Example #3
0
 /// <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);
         }
     }
 }
Example #4
0
 /// <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);
         }
     }
 }