Passing a law that requires companies to build devices with digital keyholes which only good-guys can use, is the same as passing a law that says the value of π (pi) must be exactly 3.
Here's an excellent short video about the literal impossibility of such laws, and the enormous risks of going ahead anyway. Because unlike real-world keyholes where the bad-guy must be physically present at each keyhole they want to break through, in the digital world each bad-guy can simultaneously attack millions of digital keyholes from the other side of the world. The end of the video says it best: "Anyone who says otherwise [that digital keyholes can be built which allow only angel good-guys while blocking demon bad-guys] is either ignorant of the mathematics, or less of an angel then they appear."
There's no math in the video, just really good explanation.