If I have a cryptosystem built around PGP/GnuPG, I can keep my secrets safe by using an OpenPGP smart card and storing my private keys there. If I'm instead using DJB's NaCl, is there any sort of programmable smart card that I can use to store my private keys and also the NaCl code that operates on them?
I've read about Java Cards, but it seems that the only way to put your own code onto them was through the now defunct MUSCLE project, so that doesn't seem to be a viable approach. I'd love to heard that I'm wrong about this though, as it otherwise seemed promising.
My goal is ultimately to have some degree of trusted encryption on my cell phone (a BlackBerry 10, but a solution that works for Android and iPhone would be ideal), so I'm not tied to smart cards exactly, but just the idea of offloading the private key part of the encryption onto a trusted device. If there's some way to load NaCl onto a tiny linux device and talk to that from my blackberry through NFC, that would work too. All suggestions are welcome.