void writePublicInfo(Vector publicInfo) { String publicKey = (String) publicInfo.get(0); String sig = (String) publicInfo.get(1); verifyPublicInfo(publicKey, sig); File outputFile = new File(outputFileName); try { UnicodeWriter writer = new UnicodeWriter(outputFile); MartusUtilities.writeServerPublicKey(writer, publicKey, sig); writer.close(); } catch (IOException e) { e.printStackTrace(); System.out.println("Error writing output file"); System.exit(3); } }
private void writeAccountDirectoryIdentificationFile(File accountDirectory, String accountId) throws Exception { String publicCode = MartusSecurity.computeFormattedPublicCode(accountId); File metadataDirectory = new File(accountDirectory, "metadata"); metadataDirectory.mkdirs(); File identificationFile = new File(metadataDirectory, "acct-" + publicCode + ".txt"); UnicodeWriter writer = new UnicodeWriter(identificationFile); try { writer.writeln(accountId); } finally { writer.close(); } MartusServerUtilities.createSignatureFileFromFileOnServer(identificationFile, security); }