Microsoft JScript runtime error Object doesn't support this property or method
- by Darxval
So i am trying to call this function in my javascript but it gives me the error of "Microsoft JScript runtime error Object doesn't support this property or method" and i cant figure out why. It is occuring when trying to call hmacObj.getHMAC. This is from the jsSHA website: http://jssha.sourceforge.net/ to use the hmac-sha1 algorithm encryption. Thank you!
hmacObj = new jsSHA(signature_base_string,"HEX");
signature = hmacObj.getHMAC("hgkghk","HEX","SHA-1","HEX");
Above this i have copied the code from sha.js
snippet:
function jsSHA(srcString, inputFormat) {
/*
* Configurable variables. Defaults typically work
*/
jsSHA.charSize = 8; // Number of Bits Per character (8 for ASCII, 16 for Unicode)
jsSHA.b64pad = ""; // base-64 pad character. "=" for strict RFC compliance
jsSHA.hexCase = 0; // hex output format. 0 - lowercase; 1 - uppercase
var sha1 = null;
var sha224 = null;
The function it is calling (inside of the jsSHA function) (snippet)
this.getHMAC = function (key, inputFormat, variant, outputFormat) {
var formatFunc = null;
var keyToUse = null;
var blockByteSize = null;
var blockBitSize = null;
var keyWithIPad = [];
var keyWithOPad = [];
var lastArrayIndex = null;
var retVal = null;
var keyBinLen = null;
var hashBitSize = null;
// Validate the output format selection
switch (outputFormat) {
case "HEX":
formatFunc = binb2hex;
break;
case "B64":
formatFunc = binb2b64;
break;
default:
return "FORMAT NOT RECOGNIZED";
}