Namespace: security

qz.security

Calls related to signing connection requests.
Source:

Methods

(static) getSignatureAlgorithm() → {string}

Get the signing algorithm QZ will be checking signatures against.
Since:
  • 2.1.0
Source:
Returns:
The algorithm used in signing.
Type
string

(static) setCertificatePromise(promiseHandler)

Set promise resolver for calls to acquire the site's certificate.
Parameters:
Name Type Description
promiseHandler function | Promise.<string> Either a function that will be used as a promise resolver (of format Function({function} resolve, {function}reject)), or the entire promise, either of which should return the public certificate via their respective resolve call.
Source:

(static) setSignatureAlgorithm(algorithm)

Set which signing algorithm QZ will check signatures against.
Parameters:
Name Type Description
algorithm string The algorithm used in signing. Valid values: [SHA1 | SHA256 | SHA512]
Since:
  • 2.1.0
Source:

(static) setSignaturePromise(promiseFactory)

Set promise factory for calls to sign API calls.
Parameters:
Name Type Description
promiseFactory function | Promise.<string> Either a function that accepts a string parameter of the data to be signed and returns a function to be used as a promise resolver (of format Function({function} resolve, {function}reject)), or a promise that can take a string parameter of the data to be signed, either of which should return the signed contents of the passed string parameter via their respective resolve call.
Source:
Example
qz.security.setSignaturePromise(function(dataToSign) {
   return function(resolve, reject) {
     $.ajax("/signing-url?data=" + dataToSign).then(resolve, reject);
   }
 })