Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 86845)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 86846)
@@ -1071,4 +1071,18 @@
     alert(pParent, MessageType_Error,
           tr("Public key file path is empty."));
+}
+
+void UIMessageCenter::publicKeyFileDoesntExist(const QString &strPath, QWidget *pParent /* = 0 */) const
+{
+    alert(pParent, MessageType_Error,
+          tr("Failed to open the public key file <nobr><b>%1</b></nobr>. File doesn't exist.")
+             .arg(strPath));
+}
+
+void UIMessageCenter::publicKeyFileIsOfTooLargeSize(const QString &strPath, QWidget *pParent /* = 0 */) const
+{
+    alert(pParent, MessageType_Error,
+          tr("Failed to open the public key file <nobr><b>%1</b></nobr>. File is too large for the key.")
+             .arg(strPath));
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 86845)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 86846)
@@ -310,4 +310,6 @@
     void cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0);
     void publicKeyFilePathIsEmpty(QWidget *pParent = 0) const;
+    void publicKeyFileDoesntExist(const QString &strPath, QWidget *pParent = 0) const;
+    void publicKeyFileIsOfTooLargeSize(const QString &strPath, QWidget *pParent = 0) const;
     void publicKeyFileIsntReadable(const QString &strPath, QWidget *pParent = 0) const;
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 86845)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 86846)
@@ -246,4 +246,19 @@
     }
 
+    /* Make sure file exists and is of suitable size: */
+    QFileInfo fi(strPath);
+    if (!fi.exists())
+    {
+        if (!fIgnoreErrors)
+            msgCenter().publicKeyFileDoesntExist(strPath);
+        return false;
+    }
+    if (fi.size() > 10 * _1K)
+    {
+        if (!fIgnoreErrors)
+            msgCenter().publicKeyFileIsOfTooLargeSize(strPath);
+        return false;
+    }
+
     /* Make sure file can be opened: */
     QFile file(strPath);
