Added function to retrieve private key