My scenario, I have my MacBook Air connected to a wireless network and I want to give the password to a friend to connect. Now I can go over to my Wi-Fi router and look under its casing where I have the password written on a post-it, but there must be a smarter way around this that would save me the trip. Obviously, there could be tons of reasons why you wound need access to the Wi-Fi key, e.g. you’ve misplaced or forgotten it. The easy instructions below would work on any MacOS X computer that can already connect to the wireless network in question.
MacOS stores passwords in what is called the Keychain. Bear in mind that the Keychain holds a lot more than Wi-Fi passwords, like passwords for websites and FTP servers, networks passwords and certificates.
So here is what you do on your Mac: