internal static IFreeformEntity_Msg InitKeyExchangeEndG2H_SIM(this FreeformSecurityTableCollection secTables, IFreeformEntity_Msg request) { // store the partial key of the host FFTgt_B2B_Security_KeyExchange_PartialKey tgt = request.EntityPrimaryTarget as FFTgt_B2B_Security_KeyExchange_PartialKey; SECURITY_KEY_INDEX keyIndex = FreeformEncryptionHelper.GetSecurityKeyIndex(request); byte[] gmuPartialKey = secTables.CreatePartialKeyGmu(keyIndex); secTables.StoreOtherPartialKeyGmu(keyIndex, tgt.PartialKey); secTables.CreateCommonKey(keyIndex); // send the partial key of the gmu IFreeformEntity_Msg response = request.CopyTo(FF_FlowDirection.G2H, new FFCreateEntityRequest_G2H_ResponseRequired() { MessageType = FF_AppId_G2H_MessageTypes.FreeForm, Command = FF_AppId_G2H_Commands.ResponseRequest, SkipTransactionId = true, }); FFTgt_B2B_Security tgt2 = new FFTgt_B2B_Security() { SecurityData = new FFTgt_B2B_Security_KeyExchange_End() { PartialKey = gmuPartialKey, } }; response.AddTarget(tgt2); return(response); }
internal static void InitSecurityData(IFreeformEntity_Msg message, FFTgt_B2B_Security_Data securityData) { FFTgt_B2B_Security tgt = new FFTgt_B2B_Security_ResponseRequired() { SecurityData = securityData, }; message.AddTarget(tgt); }