public void exportPEMObject(Object pemObject,String filename) throws IOException {
  Writer writer;
  writer=new FileWriter(filename);
  JcaPEMWriter jcaPemWriter=new JcaPEMWriter(writer);
  jcaPemWriter.writeObject(pemObject);
  jcaPemWriter.flush();
  jcaPemWriter.close();
}

public void exportPEMObject ( Object pemObject , String filename ) throws IOException { Writer writer ; writer = new FileWriter ( filename ) ; JcaPEMWriter jcaPemWriter = new JcaPEMWriter ( writer ) ; jcaPemWriter . writeObject ( pemObject ) ; jcaPemWriter . flush ( ) ; jcaPemWriter . close ( ) ; }
helper method for exporting pem object .
