On Monday, the U.S. Justice Department announced it had unlocked the San Bernardino shooter’s iPhone without the help of Apple Inc. (NASDAQ:AAPL), ending a legal dispute between the company and the U.S. government.

Interestingly, this whole saga could present an interesting opportunity for BlackBerry Ltd. (TSX:BB)(NASDAQ:BBRY).

The dispute between Apple and the FBI

On December 2, Syed Rizwan Farook and Tashfeen Malik, a married couple, murdered 14 people and injured 22 others in San Bernardino, California. The attack, which consisted of a mass shooting and an attempted bombing, was later called a terrorist attack by President Barack Obama. Both perpetrators were killed that day in a shootout with police.

The FBI confiscated Mr. Farook’s work iPhone, but the phone was locked. So authorities demanded that Apple provide a method to break in. Specifically, they were looking for a way to override the function whereby an iPhone erases all data after 10 wrong passcodes are entered. But Apple CEO Tim Cook refused, resulting in a legal battle.

Now that the phone has been hacked into, this specific dispute has drawn to a close. But the issue is far from dead.

The opportunity for BlackBerry

Both sides of the dispute had legitimate cases to make. On the one hand, President Obama warned against taking an “absolutist” view to privacy rights, arguing that at a certain point, it makes the country more dangerous. On the other hand, Apple warned that if it were forced to provide a so-called back door to the iPhone, then secure phones could simply be made in other countries.

This is where BlackBerry comes in. The company is known as a mobile security specialist, and, of course, its phones are designed in Canada and assembled in East Asia.

Don’t get your hopes too high

There are a couple of reasons not to get overly optimistic.

First of all, BlackBerry may not even be making phones for much longer. And if it does release new models, they will almost certainly use the Android operating system, which is not as secure as BlackBerry’s proprietary OS.

Secondly, let’s not forget that the U.S. government is also BlackBerry’s largest client. So if the company were to thumb its nose at the U.S., it might very well be bad for business.

That being the case, let’s recognize the story for what it is: another sign that Apple hasn’t quite figured out how to secure its devices. And that reinforces BlackBerry’s competitive advantage, which shareholders will be counting on to drive long-term returns.

Just released! One top stock for 2016 and beyond

Exports of liquefied natural gas could be one of the best growth opportunities out there for long-term investors. And, we think we've identified the Canadian company to invest in. It's a global company with operations across nearly 20 countries and 70 locations. We like it so much, we've named it as 1 Top Stock for 2016 and Beyond. To find out why, click here now to learn how to access your FREE copy today!

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Benjamin Sinclair has no position in any stocks mentioned. David Gardner owns shares of Apple. The Motley Fool owns shares of Apple.