Exemplo n.º 1
0
        /// <summary>
        /// <para>Generates the content of the symmetrical session
        /// key packet and stores the result in the body property
        /// of the class.</para>
        /// <para>This method SHOULD never be called directly, as it
        /// is called by the method <see cref="Generate">
        /// Generate()</see>.</para>
        /// </summary>
        /// <remarks>No remarks</remarks>
        protected override void CraftContent()
        {
            byte[] bData = new byte[0];

            int iPos = 0;

            byte[] bS2K = s2kSpecifier.CraftContent();
            bData[iPos++] = (byte)Version;
            bData[iPos++] = (byte)Algorithm;
            Array.Copy(bS2K, 0, bData, 2, bS2K.Length);
            iPos += bS2K.Length;

            if (this.bEncryptedSessionKey.Length > 0)
            {
                Array.Copy(bEncryptedSessionKey, 0, bData, iPos, bEncryptedSessionKey.Length);
            }
        }