Method ImportFileKeyRingsAsync(IRedbService, IEnumerable<string>, ILogger, CancellationToken)
Copies into redb the elements of file-system key rings that redb does not hold yet. Before
set the key manager's
repository, the key ring silently lived in the default directory of the process user, and
everything protected so far (signing keys, MFA secrets, cookies) is encrypted with those keys.
Idempotent by key id: a key already in redb is skipped, so a later start imports nothing, and
cluster nodes that each kept their own file ring each add theirs. Files are left in place. The
XML is copied as stored, encrypted elements stay encrypted with their original decryptor.
public static Task<int> ImportFileKeyRingsAsync(IRedbService redb, IEnumerable<string> directories, ILogger logger, CancellationToken ct = default)