const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
const require_types$1 = require('./types.cjs');

//#region ../../node_modules/xml-crypto/lib/signature-algorithms.js
var require_signature_algorithms = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/xml-crypto/lib/signature-algorithms.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.HmacSha1 = exports.RsaSha512 = exports.RsaSha256 = exports.RsaSha1 = void 0;
	const crypto = require("crypto");
	const types_1 = require_types$1.default;
	var RsaSha1 = class {
		constructor() {
			this.getSignature = (0, types_1.createOptionalCallbackFunction)((signedInfo, privateKey) => {
				const signer = crypto.createSign("RSA-SHA1");
				signer.update(signedInfo);
				return signer.sign(privateKey, "base64");
			});
			this.verifySignature = (0, types_1.createOptionalCallbackFunction)((material, key, signatureValue) => {
				const verifier = crypto.createVerify("RSA-SHA1");
				verifier.update(material);
				return verifier.verify(key, signatureValue, "base64");
			});
			this.getAlgorithmName = () => {
				return "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
			};
		}
	};
	exports.RsaSha1 = RsaSha1;
	var RsaSha256 = class {
		constructor() {
			this.getSignature = (0, types_1.createOptionalCallbackFunction)((signedInfo, privateKey) => {
				const signer = crypto.createSign("RSA-SHA256");
				signer.update(signedInfo);
				return signer.sign(privateKey, "base64");
			});
			this.verifySignature = (0, types_1.createOptionalCallbackFunction)((material, key, signatureValue) => {
				const verifier = crypto.createVerify("RSA-SHA256");
				verifier.update(material);
				return verifier.verify(key, signatureValue, "base64");
			});
			this.getAlgorithmName = () => {
				return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
			};
		}
	};
	exports.RsaSha256 = RsaSha256;
	var RsaSha512 = class {
		constructor() {
			this.getSignature = (0, types_1.createOptionalCallbackFunction)((signedInfo, privateKey) => {
				const signer = crypto.createSign("RSA-SHA512");
				signer.update(signedInfo);
				return signer.sign(privateKey, "base64");
			});
			this.verifySignature = (0, types_1.createOptionalCallbackFunction)((material, key, signatureValue) => {
				const verifier = crypto.createVerify("RSA-SHA512");
				verifier.update(material);
				return verifier.verify(key, signatureValue, "base64");
			});
			this.getAlgorithmName = () => {
				return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
			};
		}
	};
	exports.RsaSha512 = RsaSha512;
	var HmacSha1 = class {
		constructor() {
			this.getSignature = (0, types_1.createOptionalCallbackFunction)((signedInfo, privateKey) => {
				const signer = crypto.createHmac("SHA1", privateKey);
				signer.update(signedInfo);
				return signer.digest("base64");
			});
			this.verifySignature = (0, types_1.createOptionalCallbackFunction)((material, key, signatureValue) => {
				const verifier = crypto.createHmac("SHA1", key);
				verifier.update(material);
				return verifier.digest("base64") === signatureValue;
			});
			this.getAlgorithmName = () => {
				return "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
			};
		}
	};
	exports.HmacSha1 = HmacSha1;
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_signature_algorithms();
  }
});
//# sourceMappingURL=signature-algorithms.cjs.map