code: public static GSSExportedName decodeGSSExportedName(byte[] name_tok) {
          if (name_tok != null) {
              ByteArrayInputStream bais = new ByteArrayInputStream(name_tok);
              try {
                  // GSSToken tag 1 0x04
                  int t1 = bais.read();
                  if (t1 == ASN_TAG_NT_EXPORTED_NAME1) {
                      // GSSToken tag 2 0x01
                      int t2 = bais.read();
                      if (t2 == ASN_TAG_NT_EXPORTED_NAME2) {
                          // read the two length bytes
                          int l = bais.read() << 8;
                          l += bais.read();
  
                          // read the oid
                          byte[] oid_arr = new byte[l];
                          bais.read(oid_arr, 0, l);
                          String oid = decodeOID(oid_arr);
  
                          int l1 = bais.read();
                          int l2 = bais.read();
                          int l3 = bais.read();
                          int l4 = bais.read();
  
                          int name_len = (l1 << 24) + (l2 << 16) + (l3 << 8) + l4;
                          byte[] name_arr = new byte[name_len];
                          bais.read(name_arr, 0, name_len);
                          String name = new String(name_arr);
                          return new GSSExportedName(name, oid);
                      }
                  }
              } catch (Exception ex) {
                  ex.printStackTrace();
                  // do nothing, return null
              }
          }
          return null;
      }
docs: This function reads a name from a byte array which was created
  by the gssExportName() method.
  
  @param name_tok The GSS name token.
  @return The name from the GSS name token.