Is key used to mean the same thing in the next two sentences?

Some students had stolen the key to the final exam.

Some students cheated by using the answer key.
the same meaning