code: public void encode(OutputStream out) throws IOException {
           DerOutputStream tmp = new DerOutputStream();
           if (extensionValue == null) {
               this.extensionId = PKIXExtensions.BasicConstraints_Id;
               if (ca) {
                   critical = true;
               } else {
                   critical = false;
               }
               encodeThis();
           }
           super.encode(tmp);
  
           out.write(tmp.toByteArray());
       }
docs: Encode this extension value to the output stream.
  
  @param out the DerOutputStream to encode the extension to.