"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.compareKeys = compareKeys;
const crypto_1 = require("crypto");
function compareKeys(providedKey, expectedKey) {
    if (!providedKey || !expectedKey) {
        return false;
    }
    try {
        const providedDigest = (0, crypto_1.createHash)('sha256').update(providedKey, 'utf8').digest();
        const expectedDigest = (0, crypto_1.createHash)('sha256').update(expectedKey, 'utf8').digest();
        return (0, crypto_1.timingSafeEqual)(providedDigest, expectedDigest);
    }
    catch {
        return false;
    }
}
//# sourceMappingURL=security.util.js.map