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

@ -26,7 +26,6 @@
package sun.security.pkcs;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.util.Date;
import sun.security.x509.CertificateExtensions;
@ -530,12 +529,12 @@ public class PKCS9Attribute implements DerEncoder {
* should be encoded as <code>T61String</code>s.
*/
@Override
public void encode(DerOutputStream out) throws IOException {
public void encode(DerOutputStream out) {
DerOutputStream temp = new DerOutputStream();
temp.putOID(oid);
switch (index) {
case -1: // Unknown
temp.write((byte[])value);
temp.writeBytes((byte[])value);
break;
case 1: // email address
case 2: // unstructured name