So I've hit a little snag trying to get model.KeyPair to serialize to JSON (because this will make importing easier).
I keep getting the error as seen here: https://gist.github.com/4081176
The problem is that it's trying to JSONify the PrivateKey and PublicKey which makes sense from a default ObjectMapper. What I'd really like is that it treat those as PEMEncoded bytes like we do when we serialize the IdentityCertificate or EntitlementCertificate.
Now I was thinking this would require a custom serializer, but that seemed heavy handed and smelled (my nose so stuffed I really didn't smell anything) of overengineering because we haven't needed a custom one so far.
Any thoughts on how best to serialize this to the manifest? Is the custom serializer the best way? Or maybe add methods that return byte[] and have jackson ignore the Private and Public key methods?
Thoughts?
jesus
candlepin@lists.fedorahosted.org