class CertificateFormatter {

  public static String pemOf(final Object pemObject) throws IOException {
    final StringWriter sw = new StringWriter();
    final JcaPEMWriter writer = new JcaPEMWriter(sw);
    writer.writeObject(pemObject);
    writer.close();
    return sw.toString();
  }

  private  CertificateFormatter();

}