Implemented key file reading.