Beispiel #1
0
 public TpmHandle CreatePrimary(
     TpmHandle primaryHandle,
     SensitiveCreate inSensitive,
     TpmPublic inPublic,
     byte[] outsideInfo,
     PcrSelection[] creationPCR,
     [SuppressMessage("Microsoft.Design", "CA1021")]
     out TpmPublic outPublic,
     [SuppressMessage("Microsoft.Design", "CA1021")]
     out CreationData creationData,
     [SuppressMessage("Microsoft.Design", "CA1021")]
     out byte[] creationHash,
     [SuppressMessage("Microsoft.Design", "CA1021")]
     out TkCreation creationTicket
 )
 {
     Tpm2CreatePrimaryRequest inS = new Tpm2CreatePrimaryRequest();
     inS.primaryHandle = primaryHandle;
     inS.inSensitive = inSensitive;
     inS.inPublic = inPublic;
     inS.outsideInfo = outsideInfo;
     inS.creationPCR = creationPCR;
     TpmStructureBase outSBase;
     DispatchMethod(TpmCc.CreatePrimary, (TpmStructureBase) inS, typeof(Tpm2CreatePrimaryResponse), out outSBase, 1, 1);
     Tpm2CreatePrimaryResponse outS = (Tpm2CreatePrimaryResponse) outSBase;
     outPublic = outS.outPublic;
     creationData = outS.creationData;
     creationHash = outS.creationHash;
     creationTicket = outS.creationTicket;
     return outS.objectHandle;
 }
Beispiel #2
0
 public async Task<Tpm2CreatePrimaryResponse> CreatePrimaryAsync(
     TpmHandle primaryHandle,
     SensitiveCreate inSensitive,
     TpmPublic inPublic,
     byte[] outsideInfo,
     PcrSelection[] creationPCR)
 {
     var inS = new Tpm2CreatePrimaryRequest {
         primaryHandle = primaryHandle,
         inSensitive = inSensitive,
         inPublic = inPublic,
         outsideInfo = outsideInfo,
         creationPCR = creationPCR
     };
     TpmStructureBase outSBase = null;
     await Task.Run(() => 
         DispatchMethod(TpmCc.CreatePrimary, inS, typeof (Tpm2CreatePrimaryResponse), out outSBase, 1, 1));
     var outS = (Tpm2CreatePrimaryResponse)outSBase;
     return outS;
 }
Beispiel #3
0
 public Tpm2CreatePrimaryRequest(Tpm2CreatePrimaryRequest the_Tpm2CreatePrimaryRequest)
 {
     if((Object) the_Tpm2CreatePrimaryRequest == null ) throw new ArgumentException(Globs.GetResourceString("parmError"));
     primaryHandle = the_Tpm2CreatePrimaryRequest.primaryHandle;
     inSensitive = the_Tpm2CreatePrimaryRequest.inSensitive;
     inPublic = the_Tpm2CreatePrimaryRequest.inPublic;
     outsideInfo = the_Tpm2CreatePrimaryRequest.outsideInfo;
     creationPCR = the_Tpm2CreatePrimaryRequest.creationPCR;
 }