code: public void encode(DerOutputStream out, byte tag) throws IOException {
          byte[] bytes = id.toByteArray();
          int excessBits = bytes.length*8 - id.length();
  
          out.write(tag);
          out.putLength(bytes.length + 1);
  
          out.write(excessBits);
          out.write(bytes);
      }
docs: Encode the UniqueIdentity in DER form to the stream.
  
  @param out the DerOutputStream to marshal the contents to.
  @param tag enocode it under the following tag.
  @exception IOException on errors.