bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

CMS javadoc and closing streams

Open stevemit opened this issue 4 months ago • 1 comments

The bcpkix javadoc can be improved.

To use the CMS parsers and generators responsibly, the application programmer needs the protocol around closing the supplied underlying input and output streams. This can be gleaned by trial and error or by burrowing through the source code but it would help to have it in the top-level javadoc.

For example, CMSAuthEnvelopedDataParser drains and closes its underlying input stream and returns an input stream drawing on in-memory plaintext data. CMSAuthEnvelopedDataStreamGenerator closes its underlying output stream when the returned output stream is closed.

stevemit avatar Jul 25 '25 09:07 stevemit

Correction -- CMSAuthEnvelopedDataStreamGenerator does not close its underlying output stream.

stevemit avatar Aug 02 '25 22:08 stevemit