code: @Function
      public static byte[] getClientToken(GSSContext context) {
          byte[] initialToken = new byte[0];
  
          if (!context.isEstablished()) {
  
              try {
                  // token is ignored on the first call
                  initialToken = context.initSecContext(initialToken, 0, initialToken.length);
  
                  return getTokenWithLengthPrefix(initialToken);
              } catch (GSSException ex) {
                  throw new RuntimeException("Exception getting client token", ex);
              }
          }
  
          return null;
      }
docs: Create a token, from a clients point of view, for establishing a secure
  communication channel.  This is a client side token so it needs to bootstrap
  the token creation.
  @param context GSSContext for which a connection has been established to the remote peer
  @return a byte[] that represents the token a client can send to a server for
  establishing a secure communication channel.