title: how to serialize/deserialize X509Certificate
body: <p>I see there is code to read one in here</p>
  
  <p><a href="https://docs.oracle.com/javase/8/docs/api/java/security/cert/X509Certificate.html" rel="nofollow noreferrer">https://docs.oracle.com/javase/8/docs/api/java/security/cert/X509Certificate.html</a></p>
  
  <p>but there is no code for writing one out.</p>
  
  <p>My preference is to write a String and read a String or else I will have to base64 encode.  Anyways, how to serialize it?</p>
  
  <p>thanks,
  Dean</p>