Apple procured 10 million masks to donate to “the medical community in the United States,” its chief executive, Tim Cook, said in a video posted to Twitter on Wednesday, adding that “millions more” would be provided in Europe. A spokesman for the company declined to provide further details about the masks.

While some companies were donating what is in their reserves, Pornhub purchased and donated 50,000 surgical masks to New York-area medical professionals and emergency responders, a spokesman for the company said on Thursday. The company did not say where it obtained the masks.

Lawrence O. Gostin, a professor of global health law at Georgetown University, said that it was good that these companies and institutions had a philanthropic instinct to donate masks, but that quality checks and quality assurance were needed.

“What these companies should be doing is offering funding for the makings of new masks that have specified quality,” Mr. Gostin said. “One has to ponder how it is that private companies that just have marginal needs for masks at best have huge stockpiles that they can donate, and that the government doesn’t have enough in its strategic reserve.”

At the cathedral, the 2,000 masks not donated were being kept as a “reserve supply for pastoral needs as they rise,” said Kevin Eckstrom, a spokesman for the cathedral, but the cathedral will re-evaluate the needs in the coming days.

He said the “first priority was to get the majority of them out to the folks who need them most immediately.”

The cache of masks was stored in 30 cases in an unfinished section of a burial vault that was built in the 1920s, Mr. Alonso said. In another section, the crypt contains the remains of people interred in the cathedral and several chapels.