You should avoid using the String object and learn how to use C strings (nul terminated char arrays).
I'm guessing that your strcmp() is not equal and I'm guessing it is not equal because your variable key has a newline character '\n' at the end and the string you are testing against does not. It is a very common problem when parsing input (forgetting to remove the trailing newline).
You should also try printing out some debug statements when the strcmp() function returns non zero so you can see what's going on.