/** * Writes the certificate to the given writer. It is written in PEM format, with the * end-entity cert coming first, followed by the intermediate ceritificates. * * @param out * {@link Writer} to write to. The writer is not closed after use. */ public void writeCertificate(@WillNotClose Writer out) throws IOException { try { for (X509Certificate cert : getCertificateChain()) { AcmeUtils.writeToPem(cert.getEncoded(), AcmeUtils.PemLabel.CERTIFICATE, out); } } catch (CertificateEncodingException ex) { throw new IOException("Encoding error", ex); } }
/** * Writes the certificate to the given writer. It is written in PEM format, with the * end-entity cert coming first, followed by the intermediate ceritificates. * * @param out * {@link Writer} to write to. The writer is not closed after use. */ public void writeCertificate(@WillNotClose Writer out) throws IOException { try { for (X509Certificate cert : getCertificateChain()) { AcmeUtils.writeToPem(cert.getEncoded(), AcmeUtils.PemLabel.CERTIFICATE, out); } } catch (CertificateEncodingException ex) { throw new IOException("Encoding error", ex); } }
return CompletableFuture.completedFuture(new CertAndSigningRequest(writer.toString(), cert.getCertificateChain())); } catch (IOException e) { throw new RuntimeException(e);