Exemplo n.º 1
0
        private static string GetFileEncryptionError(string inputFilePath)
        {
            if (Directory.Exists(inputFilePath))
            {
                return(null);
            }
            if (!File.Exists(inputFilePath))
            {
                return(_fileDoesNotExist);
            }
            bool?validMagicBytes = FileHandling.IsKryptorFile(inputFilePath);

            if (validMagicBytes == null)
            {
                return(_fileInaccessible);
            }
            if (FileHandling.HasKryptorExtension(inputFilePath) || validMagicBytes == true)
            {
                return("This file is already encrypted.");
            }
            return(null);
        }