public void writeObject( PemObjectGenerator obj) throws IOException { super.writeObject(obj); } }
public void writeObject(PemObjectGenerator objGen) throws IOException { PemObject obj = objGen.generate(); writePreEncapsulationBoundary(obj.getType()); if (!obj.getHeaders().isEmpty()) { for (Iterator it = obj.getHeaders().iterator(); it.hasNext();) { PemHeader hdr = (PemHeader)it.next(); this.write(hdr.getName()); this.write(": "); this.write(hdr.getValue()); this.newLine(); } this.newLine(); } writeEncoded(obj.getContent()); writePostEncapsulationBoundary(obj.getType()); }
} else { StringWriter ksStringWriter = new StringWriter(); PemWriter pw = new PemWriter(ksStringWriter); for (int i = 1; i < caChain.length; i++) { X509Certificate cert = caChain[i]; pw.writeObject(new PemObject("CERTIFICATE", cert.getEncoded())); pw.close(); keystoreChain = ksStringWriter.toString(); Certificate[] cacerts = X509Utils.getCertificatesFromFile(mCaFilename); StringWriter caoutWriter = new StringWriter(); PemWriter pw = new PemWriter(caoutWriter); for (Certificate cert : cacerts) pw.writeObject(new PemObject("CERTIFICATE", cert.getEncoded())); pw.close(); caout = caoutWriter.toString(); } catch (Exception e) { if (caChain.length >= 1) { X509Certificate usercert = caChain[0]; PemWriter upw = new PemWriter(certout); upw.writeObject(new PemObject("CERTIFICATE", usercert.getEncoded())); upw.close();
public void writeObject(PemObjectGenerator objGen) throws IOException { PemObject obj = objGen.generate(); writePreEncapsulationBoundary(obj.getType()); if (!obj.getHeaders().isEmpty()) { for (Iterator it = obj.getHeaders().iterator(); it.hasNext();) { PemHeader hdr = (PemHeader)it.next(); this.write(hdr.getName()); this.write(": "); this.write(hdr.getValue()); this.newLine(); } this.newLine(); } writeEncoded(obj.getContent()); writePostEncapsulationBoundary(obj.getType()); }
PemWriter pWrt = new PemWriter(new OutputStreamWriter(bOut)); pWrt.writeObject(new PemObject("CERTIFICATE", ((X509Certificate)certificates.get(i)).getEncoded())); pWrt.close();
public void writeObject(PemObjectGenerator objGen) throws IOException { PemObject obj = objGen.generate(); writePreEncapsulationBoundary(obj.getType()); if (!obj.getHeaders().isEmpty()) { for (Iterator it = obj.getHeaders().iterator(); it.hasNext();) { PemHeader hdr = (PemHeader)it.next(); this.write(hdr.getName()); this.write(": "); this.write(hdr.getValue()); this.newLine(); } this.newLine(); } writeEncoded(obj.getContent()); writePostEncapsulationBoundary(obj.getType()); }
PemWriter pWrt = new PemWriter(new OutputStreamWriter(bOut)); pWrt.writeObject(new PemObject("CERTIFICATE", ((X509Certificate)certificates.get(i)).getEncoded())); pWrt.close();
public void writeObject( PemObjectGenerator obj) throws IOException { super.writeObject(obj); } }
public void writeObject( PemObjectGenerator obj) throws IOException { super.writeObject(obj); } }
public void writeObject( PemObjectGenerator obj) throws IOException { super.writeObject(obj); } }
/** * @param obj * @param encryptor * @throws IOException */ public void writeObject( Object obj, PEMEncryptor encryptor) throws IOException { try { super.writeObject(new JcaMiscPEMGenerator(obj, encryptor)); } catch (PemGenerationException e) { if (e.getCause() instanceof IOException) { throw (IOException)e.getCause(); } throw e; } }
/** * @param obj * @param encryptor * @throws java.io.IOException */ public void writeObject( Object obj, PEMEncryptor encryptor) throws IOException { try { super.writeObject(new JcaMiscPEMGenerator(obj, encryptor)); } catch (PemGenerationException e) { if (e.getCause() instanceof IOException) { throw (IOException)e.getCause(); } throw e; } }
private void writeEncoded(byte[] bytes) throws IOException { bytes = Base64.encode(bytes); for (int i = 0; i < bytes.length; i += buf.length) { int index = 0; while (index != buf.length) { if ((i + index) >= bytes.length) { break; } buf[index] = (char)bytes[i + index]; index++; } this.write(buf, 0, index); this.newLine(); } }
/** * @param obj * @param encryptor * @throws java.io.IOException */ public void writeObject( Object obj, PEMEncryptor encryptor) throws IOException { try { super.writeObject(new JcaMiscPEMGenerator(obj, encryptor)); } catch (PemGenerationException e) { if (e.getCause() instanceof IOException) { throw (IOException)e.getCause(); } throw e; } }