code: public static Signer updateDEREncodedObject(Signer signer, ASN1Encodable tbsObj)
          throws IOException
      {
          OutputStream sOut = signer.getOutputStream();
          DEROutputStream dOut = new DEROutputStream(sOut);
  
          dOut.writeObject(tbsObj);
  
          sOut.close();
  
          return signer;
      }
docs: DER encode an ASN.1 object into the given signer and return the signer.
  
  @param signer a signer.
  @param tbsObj the object to sign.
  @return a the signer for chaining.
  @throws java.io.IOException on encoding error.