Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes all calls to KJUR.jws.JWS.isSafeJSONString static in jws-3.0.js - ... #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jws-3.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ KJUR.jws.JWS = function() {
this.parsedJWS.headS = sHead;
this.parsedJWS.payloadS = sPayload;

if (! this.isSafeJSONString(sHead, this.parsedJWS, 'headP'))
if (! KJUR.jws.JWS.isSafeJSONString(sHead, this.parsedJWS, 'headP'))
throw "malformed JSON string for JWS Head: " + sHead;
};

Expand Down Expand Up @@ -273,7 +273,7 @@ KJUR.jws.JWS = function() {
* @deprecated from 3.0.0 please move to {@link KJUR.jws.JWS.sign}
*/
this.generateJWSByNED = function(sHead, sPayload, hN, hE, hD) {
if (! this.isSafeJSONString(sHead)) throw "JWS Head is not safe JSON string: " + sHead;
if (! KJUR.jws.JWS.isSafeJSONString(sHead)) throw "JWS Head is not safe JSON string: " + sHead;
var sSI = _getSignatureInputByString(sHead, sPayload);
var hSigValue = _jws_generateSignatureValueBySI_NED(sHead, sPayload, sSI, hN, hE, hD);
var b64SigValue = hextob64u(hSigValue);
Expand Down Expand Up @@ -302,7 +302,7 @@ KJUR.jws.JWS = function() {
*/
this.generateJWSByKey = function(sHead, sPayload, key) {
var obj = {};
if (!this.isSafeJSONString(sHead, obj, 'headP'))
if (!KJUR.jws.JWS.isSafeJSONString(sHead, obj, 'headP'))
throw "JWS Head is not safe JSON string: " + sHead;
var sSI = _getSignatureInputByString(sHead, sPayload);
var b64SigValue = _jws_generateSignatureValueBySI_Key(sHead, sPayload, sSI, key, obj.headP);
Expand Down Expand Up @@ -341,7 +341,7 @@ KJUR.jws.JWS = function() {
* @deprecated from 3.0.0 please move to {@link KJUR.jws.JWS.sign}
*/
this.generateJWSByP1PrvKey = function(sHead, sPayload, sPemPrvKey) {
if (! this.isSafeJSONString(sHead)) throw "JWS Head is not safe JSON string: " + sHead;
if (! KJUR.jws.JWS.isSafeJSONString.isSafeJSONString(sHead)) throw "JWS Head is not safe JSON string: " + sHead;
var sSI = _getSignatureInputByString(sHead, sPayload);
var hSigValue = _jws_generateSignatureValueBySI_PemPrvKey(sHead, sPayload, sSI, sPemPrvKey);
var b64SigValue = hextob64u(hSigValue);
Expand Down