Electronic lock that controls access to a building or vehicle without using a traditional mechanical key