When I use web3.eth.sign, web3.eth.personal.sign functions to sign data I should pass to them account address.
eth.sign(dataToSign, address [, callback])
eth.personal.sign(dataToSign, address, password [, callback])
My understanding is that these functions are usually provided with address by connecting to Ethereum node. Then my understanding is that these functions communicate with node to retrieve respective for the address private key.
If I run these functions on a client that does not connected to a node, how these functions can be used to sign data? I guess they would get private key from keystore file or passphrase, or metamask that are available locally. How the retrieval of private key from these local sources is done, passed to web3.eth.sign, web3.eth.personal.sign functions? An example, would be very much appreciated.