I found the key and used it to open the cabinet, and then used the thing in the cabinet, and still can't figure out the door code...
Edit: never mind; found a walkthrough on YouTube and saw the answer below. Ah, it's like the old school days of puzzle adventures...