The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES and JSON Web Signature/Token in pure JavaScript.
I needed to seed the PRNG with a specific value. After some poking around I found that it can be done like so:
function hex2Array(hex) { var arr = new Array(); for (var i = 0; i < hex.length; i += 2) arr[i/2] = parseInt(hex.substr(i, 2), 16); return arr; }
var seedByteArray = hex2Array(seedHexStr);
//////////////// rng_state = prng_newstate(); rng_state.init(seedByteArray); ///////////////
It might be nice to add these last two lines into a "seed" function of the SecureRandom class in the future