Fix issue 430: use device.public_key everywhere, instead of mixing with getting the public_key from Settings

title says it all. didn't bother testing; this will be tested by others, elsewhere.