Add the ability to serialize an identity