Use the same method used in zfs-load-key. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Llewelyn Trahaearn <WoefulDerelict@GMail.com> Signed-off-by: Matthew Thode <mthode@mthode.org> Closes #7089