diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java b/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java index d8325a43..8a0a0396 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/Certificate.java @@ -114,6 +114,21 @@ public class Certificate extends AcmeResource { } } + /** + * Writes the certificate and the intermediate certificates to the given writer. + * They are written in PEM format, with the end-entity cert coming first, followed + * by the intermediate certificates. + * This method just calls writeCertificateAndChain. + * + * @see #writeCertificateAndChain + * + * @param out + * {@link Writer} to write to. The writer is not closed after use. + */ + public void writeCertificate(@WillNotClose Writer out) throws IOException { + writeCertificateAndChain(out); + } + /** * Writes the certificate and the intermediate certificates to the given writer. * They are written in PEM format, with the end-entity cert coming first, followed @@ -138,7 +153,7 @@ public class Certificate extends AcmeResource { * @param out * {@link Writer} to write to. The writer is not closed after use. */ - public void writeCertificate(@WillNotClose Writer out) throws IOException { + public void writeCertificateOnly(@WillNotClose Writer out) throws IOException { try { AcmeUtils.writeToPem(getCertificate().getEncoded(), AcmeUtils.PemLabel.CERTIFICATE, out); } catch (CertificateEncodingException ex) {