The TS_UD_CS_SEC data block contains security-related information used to advertise client cryptographic support. This information is only relevant when Standard RDP Security is in effect, as opposed to Enhanced RDP Security. See sections and for a detailed discussion of how this information is used.
file:///C:/ts_dev/TestSuites/MS-RDPBCGR/TestSuite/Src/TD/latest_XMLS_16may/RDPBCGR/ _rfc_ms-rdpbcgr2_1_1_3_3.xml
        /// <summary>
        /// Parse TS_UD_SC_SEC1
        /// (parser index is updated according to parsed length)
        /// </summary>
        /// <param name="data">data to be parsed</param>
        /// <param name="currentIndex">current parser index</param>
        /// <returns>TS_UD_SC_SEC1</returns>
        private TS_UD_CS_SEC ParseTsUdCsSec(byte[] data, ref int currentIndex)
        {
            TS_UD_CS_SEC secData = new TS_UD_CS_SEC();

            // reserve the start index
            int startIndex = currentIndex;

            // TS_UD_SC_SEC1: header
            secData.header.type = (TS_UD_HEADER_type_Values)ParseUInt16(data, ref currentIndex, false);
            secData.header.length = ParseUInt16(data, ref currentIndex, false);

            // TS_UD_SC_SEC1: encryptionMethod
            secData.encryptionMethods = (encryptionMethod_Values)ParseUInt32(data, ref currentIndex, false);

            // TS_UD_SC_SEC1: encryptionLevel
            secData.extEncryptionMethods = (uint)ParseUInt32(data, ref currentIndex, false);

            return secData;
        }
 public void VerifyStructure(TS_UD_CS_SEC sec)
 {
     Site.CaptureRequirementIfAreEqual<TS_UD_HEADER_type_Values>(sec.header.type, TS_UD_HEADER_type_Values.CS_SECURITY, 209,
         "In Client Security Data (TS_UD_CS_SEC), User Data Header type field MUST be set to CS_SECURITY (0xC002).");
     uint encryptionMethods = (uint)encryptionMethod_Values._40BIT_ENCRYPTION_FLAG | (uint)encryptionMethod_Values._56BIT_ENCRYPTION_FLAG
         | (uint)encryptionMethod_Values._128BIT_ENCRYPTION_FLAG | (uint)encryptionMethod_Values.FIPS_ENCRYPTION_FLAG;
     uint negEncryptionMethods = ~encryptionMethods;
     bool isR213Satisfied = ((uint)sec.encryptionMethods & negEncryptionMethods) == 0;
     Site.CaptureRequirementIfIsTrue(isR213Satisfied, 213,
         @"In Client Security Data, encryptionMethods can take one of the following values:  \r\n40BIT_ENCRYPTION_FLAG "
         + @"0x00000001,\r\n128BIT_ENCRYPTION_FLAG 0x0000000,\r\n256BIT_ENCRYPTION_FLAG 0x00000008,\r\nFIPS_ENCRYPTION_FLAG 0x00000010");
     //<?> should decide whether is french clients
     Site.CaptureRequirementIfAreEqual<uint>(sec.extEncryptionMethods, 0,
         222,
         "In Client Security Data for non-French locale clients, the extEncryptionMethods field MUST be set to 0. ");
 }
 public ConnectGCC()
 {
     clientCoreData = new TS_UD_CS_CORE();
     clientSecurityData = new TS_UD_CS_SEC();
 }