Skip to content

Instantly share code, notes, and snippets.

@tresf
Last active November 27, 2019 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tresf/9824f51475d39d01be29517af5980394 to your computer and use it in GitHub Desktop.
Save tresf/9824f51475d39d01be29517af5980394 to your computer and use it in GitHub Desktop.
// API
setSignaturePromise: function(promiseGen, alg) {
_qz.security.signaturePromise = promiseGen;
// TODO: Detect QZ version, warn
_qz.security.signatureAlg = alg;
}
// Implementation
qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
$.ajax("/secure/url/for/sign-message?request=" + toSign + "&alg=" qz.security.getSignatureAlg()).then(resolve, reject);
};
}, 'sha1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment