示例#1
0
        public void Connect(IRibbonControl control)
        {
            ECDsaCng key = null;

            if (string.IsNullOrEmpty(SecretariumFunctions.Scp.PublicKey))
            {
                MessageBox.Show("Please register you identity first", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (key != null && key.PublicKey().ToBase64String() != SecretariumFunctions.Scp.PublicKey)
            {
                SecretariumFunctions.Scp.Set(key);
            }

            if (SecretariumFunctions.Scp.State.IsClosed())
            {
                SecretariumFunctions.Scp.Connect();
            }
        }