There was a lot of talk of trust between two friends when President Reagan and Japanese Prime Minister Yasuhiro Nakasone met here the day after the new year began.

But the unfortunate truth is that, on the subject of trade, trust between the two governments is deeply strained, both sides agree. Many American businessmen who have tried to sell in Japanese markets mistrust Japanese intentions, as do Reagan administration officials, who talk of "mounting frustrations" in trade negotiations with Japan. It is the one major irritant in the otherwise rosy relationship between the United States and its key political and strategic ally in the Pacific.

A recently released U.S. government report, for instance, belittled past Japanese commitments to ease trade frictions by expanding opportunities for U.S. exporters, charging that their highly touted promises have produced only "marginal" gains for American business.

And the issue of trust was a central theme in the Reagan-Nakasone meeting, with the administration voicing its concern that Tokyo may be attempting to keep sophisticated U.S. telecommunications equipment and computer software out of Japan.

The Japanese vehemently deny any such intent, but many U.S. businessmen and government officials say they just don't accept Japanese assurances at face value.

They see recent Japanese moves in those two high-technology fields as a repetition of past actions that protected Japan's home market from foreign competition to give Japan's industries a chance to build themselves into world-class competitors. The protected domestic market provided the springboard for Japanese companies to score export successes in the rest of the world.

A senior administration official, briefing reporters at Palm Springs two days before the Reagan-Nakasone meeting, described a proposal by Japan's Ministry of International Trade and Industry (MITI) for compulsory licensing of software as "a legal form" of past "illegal attempts to get hold of American software by Japanese companies." And the move to turn Japan's government-owned telecommunications monopoly, Nippon Telegraph and Telephone (NTT), into a private company is seen as a way to keep sophisticated U.S. telecommunications equipment from the Japanese market.

Nakasone's government is well aware of this deep strain of mistrust, which a senior official in the Nakasone party said disturbs and frustrates the Japanese.

"We honestly feel we have never been antagonistic toward America," the official said in a background briefing here with a few American reporters the night before the summit talks.

"And yet we have always been accused of something we have never thought we are doing -- like we are cheating, which is a great insult.

"We have no intention of cheating anyone, particularly the United States. We are frustrated and disturbed. We feel it the feeling of mistrust doesn't suit the American dignity. After all, America is a great nation," he continued.

At the end of the Reagan-Nakasone conference, U.S. officials remained convinced that the Japanese prime minister means it when he pledges further efforts to open his country's markets to American business and investors. Clearly, President Reagan, who after five meetings considers Nakasone a friend, trusts the Japanese prime minister to keep his word.

But the question persists: Do the personal bonds that have developed between the two leaders carry through for the nation as a whole? And can Nakasone's commitment overcome the many obstacles to a more balanced trade between the two nations?

"When we have gotten commitments from this man at this level, they have been carried out," a senior administration official said in a briefing for reporters here after the Reagan-Nakasone meeting Wednesday.

The most striking example is Nakasone's unprecedented personal intervention last year to force his bureaucracy to make good on his commitment to the United States to liberalize Japan's financial markets, making it easier for foreigners to invest, the same official said.

The American official said the tenor of Nakasone's intervention went something like this: " 'Look, I made a commitment to the president . . . that we're going to carry through on these things. Now don't tell me 12 reasons why you can't do anything. Get something done.' "

Even administration officials such as Commerce Undersecretary Lionel H. Olmer, who recommended that the president take a harder line with Japan on trade by demanding that it set specific quotas for imports of manufactured goods, believe Nakasone truly wants to keep his commitments.

"We couldn't ask for more support than we have gotten at a political level from the Japanese," he said in Washington the week before the Reagan-Nakasone meeting.

"Prime Minister Nakasone has already done things which would at one time put him in some political jeopardy. There is no doubt whatsoever in my mind that many in the Japanese bureaucracy at the top level are absolutely behind the process of liberalizing trade and investment and financial affairs in Japan.

"The question is how long will it take for that policy at the top to trickle down throughout the bureaucracy and move the bureaucracy in a way that will reduce our trade deficit."

Administration officials acknowledge that even fully open Japanese markets would not fully erase the United States' trade deficit with Japan, which soared to an estimated $35 billion for 1984.

But the senior administration official estimated that competitive American-manufactured products worth $10 billion are being kept out of Japan by protectionist measures that President Reagan asked Nakasone to stop.

These include high-technology telecommunications equipment, sophisticated electronic computers, manufactured forest products and new types of medical equipment and pharmaceuticals.

Ending the protected Japanese market for those products, in which the United States is considered highly competitive, means more than just easing the American trade deficit.

An increase in sales in international markets gives American companies added capital for the extremely costly research and development needed to maintain their technological advantage. It also deprives competing Japanese firms of a free run in their market, the second-largest in the world behind the United States.

Japan, for instance, has refused to date to buy American telecommunications satellites as part of a program to develop its own space industry. With the Japanese home market protected, the United States fears Japan will gain an export advantage that will allow it to undercut sales of American satellites in other markets.

Japan maintains that its markets are open, citing new tariff cuts and past agreements to allow some American products in. And its officials say that Japanese are "frustrated" that trade remains a thorny issue with the United States.

U.S. trade negotiators report being told by their Japanese counterparts that they are not properly appreciative of Japan's past market-opening moves and should stop pressing new trade complaints.

A senior Japanese official said Americans such as Commerce Undersecretary Olmer create "some embarrassment" among Japanese because "he emphasizes particular areas" where there are problems.

"It's rather frustrating from our standpoint that the U.S. government or some people in it will not see the brighter side," the Japanese official continued. "That is rather discouraging."

Japan places most of the blame for its burgeoning trade surplus with the United States on an overvalued dollar caused by the record Reagan administration budget deficits.

The Japanese say another important explanation is the failure of American businessmen to tailor their products to the Japanese market or to mount aggressive, effective sales efforts there.

A senior administration official indicated that Reagan brushed aside those arguments when they were put forward during his talk with Nakasone.

"It is an answer to part of the problem," the administration official said.

"But that's not the reason our telecommunications products are not selling in Japan the way Japan's are selling in the United States. That's not the reason why our forest products are not selling in Japan. There are a lot of areas where it's got nothing to do with aggressive marketing, and those are the areas where we want to see solutions," the U.S. official said.

The question remains, however, whether the homogenous Japanese society has become resistant to imports in its drive to become a world-class economic power.

Even though it has the second-largest economy in the world, its imports are no greater than Switzerland's.

U.S. Trade Representative William E. Brock often cites Japan's lackluster record in buying products from developing countries, many of which need to export to repay massive debts to multilateral lending institutions and major banks, including Japan's.

Less-developed countries sell 58 percent of their manufactured goods in the United States, 28 percent in Western Europe, but only 8 percent in the booming economy of Japan, according to figures Brock cites.

Senior Japanese officials denied their country resists imports and said foreign-made products carry a certain cachet as somehow being better than something made in Japan.

Not all American trade officials agree.

Two years ago this month, when a newly elected Nakasone paid his first visit as prime minister to the United States, Brock mused about a recurring nightmare.

"What happens," he asked, "if and when the Japanese government does everything we've asked and things don't change that much because of societal attitudes in Japan such as insecurity and insularity on their part that leads them to believe it is unpatriotic to import things from other countries?"

Despite efforts by prime ministers such as Nakasone, it may be difficult for the people of Japan to realize "it is in their interest to import just as it is to export" Brock continued.

This time, some administration officials such as Olmer suggested the Japanese make imports as big a national priority as exports and set goals listing specific amounts of foreign-manufactured products the country will buy each year.

The Japanese lobbied hard in Washington against that proposal; Nakasone rejected it and, in the end, Reagan decided not to adopt it as part of administration strategy.

In rejecting the notion of setting specific import goals, however, the onus of proving that Japan is not an import-resistant nation falls squarely on Nakasone just as he now bears the responsibility for demonstrating with results that Japan can be trusted to keep its word in international trade, U.S. officials say.

That's a tough load, even for a man as strong as Nakasone, because the atmosphere of the recent talks created the impression that results would follow and Japan would offer equal access to American telecommunications equipment, computers, forest products, medical equipment and drugs.

If they don't, the mistrust of Japan in the United States will grow despite Nakasone's ringing words that "trust, responsibility and friendship" are keystones of U.S.-Japanese relations.