crypto: introduce .setEngine(engine, [flags])

fix #6680

/cc @tjfontaine @trevnorris