Speaking at the Leveson inquiry, set up in the wake of the phone hacking scandal, Ryley said that it is "highly unlikely" that Sky News will break the law again, but he stopped short of completely ruling it out.
Earlier in the month, Sky News - part-owned by Rupert Murdoch - confirmed that it had accessed the accounts of 'canoe man' John Darwin and his wife Anne, along with a suspected paedophile.
At the time, Ryley insisted that the actions were justified in the "public interest", and also questioned the "double standards" of The Guardian, which highlighted the email hacking.
However, media regulator Ofcom has confirmed that it is to investigate the email hacking to see if their were potential "fairness and privacy" breaches by the broadcaster.
At the hearing today, Lord Leveson asked Ryley: "Where does the Ofcom code give authority to a breach of the criminal law?"
To this, he replied: "It doesn't."
Sky has argued that the hacking of the emails of Darwin, who faked his own death as part of an insurance fraud, was in the public interest as it gathered evidence showing his wife Anne's involvement in the crime.
There is no such technical defence available under the Computer Misuse Act, but Sky argued that the Crown Prosecution Service has said that it can sometimes be justified for a journalist to commit the offence where the story is in the public interest.
Asked where Sky News might in future consider breaking the law in pursuit of a story, Ryley replied: "Journalism is at times a tough business. And we need at times to shed light into wrongdoing. There may be an occasion. It would be very, very rare."
Ryley also apologised to Lord Leveson after the broadcaster had previously claimed that it had not engaged in any hacking, when in fact senior executives knew it had.
He said that it was "highly regrettable" that a lawyer representing Sky News had written to the inquiry last year, stating: "Sky News editorial and reporting staff to whom we have spoken have never intercepted communications."
At the time the letter was sent, Ryley and other executives at Sky News were aware that reporter Gerard Tubb had hacked the email accounts belonging to Darwin and a woman who had killed her own children.
Also this week, the Leveson Inquiry will hear evidence from other newspaper owners, including Rupert Murdoch and his son James Murdoch.
Currently, the inquiry is hearing from Aidan Barclay, the chairman of Telegraph Media Group, and Evgeny Lebedev, owner of The Independent and London Evening Standard.
> Michael Moore believes hacking scandal will spread to Fox News