"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultStorageEntryKeysFactory = void 0;
const utils_1 = require("../crypto/utils");
/**
 * Default implementation for {@link StorageEntryKeysFactory}, compatible with legacy local storage keys.
 */
class DefaultStorageEntryKeysFactory {
    cachedRecoveredKeypairOfDataOwner(dataOwnerId, publicKeyFingerprint) {
        if (!(0, utils_1.fingerprintIsV2)(publicKeyFingerprint) && !(0, utils_1.fingerprintIsV1)(publicKeyFingerprint))
            throw new Error(`Invalid key fingerprint: ${publicKeyFingerprint}`);
        return `org.taktik.icure.rsa.recovered.${dataOwnerId}.${publicKeyFingerprint}`;
    }
    deviceKeypairOfDataOwner(dataOwnerId, publicKeyFingerprint) {
        if (!(0, utils_1.fingerprintIsV2)(publicKeyFingerprint) && !(0, utils_1.fingerprintIsV1)(publicKeyFingerprint))
            throw new Error(`Invalid key fingerprint: ${publicKeyFingerprint}`);
        return `org.taktik.icure.rsa.device.${dataOwnerId}.${publicKeyFingerprint}`;
    }
    selfPublicKeysVerificationCacheForDataOwner(dataOwnerId) {
        return `org.taktik.icure.rsa.${dataOwnerId}.verification.self`;
    }
    signatureKeyForDataOwner(dataOwnerId) {
        return `org.taktik.icure.rsa.sign.${dataOwnerId}.self`;
    }
    signatureVerificationKeyForDataOwner(dataOwnerId, publicKeyFingerprint) {
        return `org.taktik.icure.rsa.sign.verify.${dataOwnerId}.${publicKeyFingerprint}`;
    }
}
exports.DefaultStorageEntryKeysFactory = DefaultStorageEntryKeysFactory;
//# sourceMappingURL=DefaultStorageEntryKeysFactory.js.map