code: public void derEncode(OutputStream out) throws IOException {
          DerOutputStream seq = new DerOutputStream();
          seq.putInteger(version);
          DerOutputStream issuerAndSerialNumber = new DerOutputStream();
          issuerName.encode(issuerAndSerialNumber);
          issuerAndSerialNumber.putInteger(certificateSerialNumber);
          seq.write(DerValue.tag_Sequence, issuerAndSerialNumber);
  
          digestAlgorithmId.encode(seq);
  
          // encode authenticated attributes if there are any
          if (authenticatedAttributes != null)
              authenticatedAttributes.encode((byte)0xA0, seq);
  
          digestEncryptionAlgorithmId.encode(seq);
  
          seq.putOctetString(encryptedDigest);
  
          // encode unauthenticated attributes if there are any
          if (unauthenticatedAttributes != null)
              unauthenticatedAttributes.encode((byte)0xA1, seq);
  
          DerOutputStream tmp = new DerOutputStream();
          tmp.write(DerValue.tag_Sequence, seq);
  
          out.write(tmp.toByteArray());
      }
docs: DER encode this object onto an output stream.
  Implements the <code>DerEncoder</code> interface.
  
  @param out
  the output stream on which to write the DER encoding.
  
  @exception IOException on encoding error.