A gold key.
Keys are created when you put gold in a furnace, or gold in a blank key mold. Keys are used to lock and unlock appropriate doors,chests, and trapdoors. Keys can also be named when you create them, so you can have separate keys for separate doors. You can also build several doors that use the same key.
Keys can be copied by using a duplicate key mold. Keys made from one can be used on the same locks the original key was set to.