예제 #1
0
 public ScrambledKeyPair( ref RSAParameters pivateKey, ref RSAParameters publicKey )
 {
     m_RSAManaged = new RSAManaged(1024);
     pivateKey = m_RSAManaged.ExportParameters(true);
     publicKey = m_RSAManaged.ExportParameters(false);
     m_ScrambledModulus = ScrambleModulus(publicKey.Modulus);
 }
        /// <summary>
        /// Initializes user connections listener.
        /// </summary>
        /// <param name="localEndPoint">Local ip endpoint.</param>
        /// <param name="backlog">Backlog.</param>
        /// <param name="enableFirewall">True, if firewall must be enabled, otherwise false.</param>
        internal static void Initialize( IPEndPoint localEndPoint, int backlog, bool enableFirewall )
        {
            m_LocalEndPoint = localEndPoint;
            m_Backlog = backlog;
            m_EnableFirewall = enableFirewall;

            RSAManaged rsa = new RSAManaged(1024);

            PrivateKey = rsa.ExportParameters(true);
            PublicKey = rsa.ExportParameters(false);

            ScrambledKeysPair = new ScrambledKeyPair(ref PrivateKey, ref PublicKey);

            rsa = null;

            Enable();
        }