8297065: DerOutputStream operations should not throw IOExceptions

Reviewed-by: mullan, valeriep
This commit is contained in:
Weijun Wang 2022-11-29 12:57:46 +00:00
parent d83a07b72c
commit 2deb318c9f
109 changed files with 725 additions and 1112 deletions

View file

@ -436,18 +436,6 @@ public class PKCS7 {
}
}
/**
* Encodes the signed data to an output stream.
*
* @param out the output stream to write the encoded data to.
* @exception IOException on encoding errors.
*/
public void encodeSignedData(OutputStream out) throws IOException {
DerOutputStream derout = new DerOutputStream();
encodeSignedData(derout);
out.write(derout.toByteArray());
}
/**
* Encodes the signed data to a DerOutputStream.
*
@ -850,7 +838,7 @@ public class PKCS7 {
: new ContentInfo(content);
PKCS7 pkcs7 = new PKCS7(algorithms, contentInfo,
signerChain, signerInfos);
ByteArrayOutputStream p7out = new ByteArrayOutputStream();
DerOutputStream p7out = new DerOutputStream();
pkcs7.encodeSignedData(p7out);
return p7out.toByteArray();