How to generate Access keys for Document print web view link


I want to know how to generate Access Keys into URL in Web View link as shown below.

The point is that I want my customers to have access to their invoices in web view and only them can access.

{{frappe.utils.get_url_to_form(doc.doctype,}}?&key=(Unique key herre)

For people wondering :

frappe.get_doc(‘DocType’, ‘Docname’).get_signature()