London (CNN) -- Former News of the World journalist and royal editor Clive Goodman told a court in London Thursday that Princess Diana had leaked a royal phone book to him, UK media reported.
Goodman, who denies two counts of conspiracy to commit misconduct in a public office, told the court that Diana had sent a phone directory and other details about the royal household to the newspaper's office in east London, the Press Association news agency reported.
He said Diana, who separated from husband Prince Charles in 1992 after 11 years of marriage, had been in need of "an ally" at a very difficult time, the news agency said.
"She told me she wanted me to see the scale of her husband's staff and household, compared with others," the Press Association quoted Goodman as saying.
"She felt she was being swamped by people close to his household. She was looking for an ally to take him on -- to show there were forces that would rage against him."
One so-called "Green Book," containing confidential phone numbers of royals and their staff, arrived at his office in an envelope with his name on it, Goodman said.
Goodman told the court he did not pay for the information, the Press Association reported.
Charles and Diana divorced in 1996. Diana died a year later, after the car she was riding in slammed into a pillar in a Paris overpass. Her boyfriend, Dodi Fayed, and their driver, Henri Paul, also died.
Goodman is one of seven people on trial on phone hacking charges.
Others include Rebekah Brooks, former chief executive of News International and onetime editor of The Sun and News of the World newspapers, and Andy Coulson, a former News of the World editor who went on to work for Prime Minister David Cameron. They deny the charges against them.
The jury has previously been told that Goodman pleaded guilty in 2007 to phone hacking charges.
The News of the World was closed down by News International, a UK division of Rupert Murdoch's News Corp., in 2011 amid public outrage over claims its employees had hacked the voice mail of a British schoolgirl who went missing and was later found murdered in 2002.