Giter VIP home page Giter VIP logo

Comments (5)

shred avatar shred commented on June 15, 2024 1

In commit 7c03309, I have added a new writer for writing the leaf certificate and certificate chain, and documented that the writers are closed after use. It will be available with the next release.

from acme4j.

shred avatar shred commented on June 15, 2024

You are right... I am going to fix this. Thanks!

from acme4j.

ea1111 avatar ea1111 commented on June 15, 2024

After thinking about it again, it seems to me that fixing this could be tricky. As the JcaPEMWriter is created in writeX509Certificate(...), the caller has no way to close or flush it...

from acme4j.

shred avatar shred commented on June 15, 2024

I am not very comfortable with the idea either, as I would change the behavior of the methods. Some people might expect that they don't need to care about closing the writers, e. g. by using a construction like CertificateUtils.writeX509Certificate(cert, new FileWriter("foo.csr"));.

The only use case I see is to write a combined file of the leaf certificate and the certificate chain. So maybe a new method writeX509Certificates(Writer w, X509Certificate leaf, X509Certificate[] chain) would also resolve the issue?

from acme4j.

ea1111 avatar ea1111 commented on June 15, 2024

Yes, that's pretty much my use case, though I have to insert some custom text in between. However, for such cases it should be straightforward to use Bouncy Castle's JcaPEMWriter directly. Therefore I do not think that it is necessary to introduce an additional method.

Instead I would suggest to explicitly state in the javadoc that writeX509Certificate(...) and writeX509CertificateChain(...) do close the passed-in stream/writer. It would also be great to have a pointer to JcaPEMWriter somewhere in the documentation and maybe some example code.

from acme4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.