mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8296072: CertAttrSet::encode and DerEncoder::derEncode should write into DerOutputStream
Reviewed-by: xuelei, mullan
This commit is contained in:
parent
37107fc157
commit
0d0bd7bd40
50 changed files with 209 additions and 314 deletions
|
@ -26,7 +26,6 @@
|
|||
package sun.security.x509;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.*;
|
||||
|
@ -233,18 +232,17 @@ implements CertAttrSet<String>, Cloneable {
|
|||
/**
|
||||
* Write the extension to the OutputStream.
|
||||
*
|
||||
* @param out the OutputStream to write the extension to.
|
||||
* @param out the DerOutputStream to write the extension to.
|
||||
* @exception IOException on encoding errors.
|
||||
*/
|
||||
public void encode(OutputStream out) throws IOException {
|
||||
DerOutputStream tmp = new DerOutputStream();
|
||||
@Override
|
||||
public void encode(DerOutputStream out) throws IOException {
|
||||
if (this.extensionValue == null) {
|
||||
this.extensionId = PKIXExtensions.NameConstraints_Id;
|
||||
this.critical = true;
|
||||
encodeThis();
|
||||
}
|
||||
super.encode(tmp);
|
||||
out.write(tmp.toByteArray());
|
||||
super.encode(out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue