UNPKG

saml-login

Version:
41 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSigner = exports.getDigestAlgorithm = exports.getSigningAlgorithm = void 0; const crypto = require("crypto"); function getSigningAlgorithm(shortName) { switch (shortName) { case "sha1": return "http://www.w3.org/2000/09/xmldsig#rsa-sha1"; case "sha512": return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"; case "sha256": default: return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"; } } exports.getSigningAlgorithm = getSigningAlgorithm; function getDigestAlgorithm(shortName) { switch (shortName) { case "sha1": return "http://www.w3.org/2000/09/xmldsig#sha1"; case "sha512": return "http://www.w3.org/2001/04/xmlenc#sha512"; case "sha256": default: return "http://www.w3.org/2001/04/xmlenc#sha256"; } } exports.getDigestAlgorithm = getDigestAlgorithm; function getSigner(shortName) { switch (shortName) { case "sha1": return crypto.createSign("RSA-SHA1"); case "sha512": return crypto.createSign("RSA-SHA512"); case "sha256": default: return crypto.createSign("RSA-SHA256"); } } exports.getSigner = getSigner; //# sourceMappingURL=algorithms.js.map