Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createURLSignature(privateKeyPem, signedPayload, sigAlg) {
const privateKeyPemWithHeaders = pemFormatting.addPEMHeaders("RSA PRIVATE KEY", privateKeyPem);
const signingAlgorithmName = resolveSignatureAlgorithm(sigAlg);
return SignedXml
.prototype
.findSignatureAlgorithm(signingAlgorithmName)
.getSignature(signedPayload, privateKeyPemWithHeaders);
}