ns-auth-sdk 1.14.2 → 1.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -216,7 +216,7 @@ async function checkPRFSupport() {
216
216
  }
217
217
  }
218
218
  async function generatePasswordProtectedKey(password) {
219
- const privateKey = secp256k1.utils.randomPrivateKey();
219
+ const privateKey = secp256k1.utils.randomSecretKey();
220
220
  const publicKeySpkiBase64 = toBase64(secp256k1.getPublicKey(privateKey));
221
221
  const salt = randomBytes(16);
222
222
  const derivedKey = pbkdf2(sha256, new TextEncoder().encode(password), salt, {
@@ -11260,7 +11260,7 @@ async function generateSiopIdToken(config) {
11260
11260
  };
11261
11261
  const signingInput = `${base64urlEncode$1(new TextEncoder().encode(JSON.stringify(header)))}.${base64urlEncode$1(new TextEncoder().encode(JSON.stringify(payload)))}`;
11262
11262
  const messageHash = sha256(new TextEncoder().encode(signingInput));
11263
- return `${signingInput}.${base64urlEncode$1(secp256k1.sign(messageHash, secretKey).toCompactRawBytes())}`;
11263
+ return `${signingInput}.${base64urlEncode$1(secp256k1.sign(messageHash, secretKey).toBytes())}`;
11264
11264
  }
11265
11265
  /**
11266
11266
  * Verify a SIOP v2 Self-Issued ID Token