Javascript Object Signing and Encryption