fix typo
diff --git a/main.cpp b/main.cpp
index 8e02817..1abccdd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -6363,8 +6363,8 @@
 
     // pubkey is a special extension used by the SDK, to indicate a PEM or DER file
     if (!(get_file_type_idx(2) == filetype::pem ||
-        get_file_type_idx(2) != filetype::der ||
-        get_file_type_idx(2) != filetype::pubkey
+        get_file_type_idx(2) == filetype::der ||
+        get_file_type_idx(2) == filetype::pubkey
     )) {
         fail(ERROR_ARGS, "Can only read PEM or DER keys");
     }