public static IServiceCollection AddWebKeyDirectory(this IServiceCollection services, IDirectoryContents directory) { var keyManagement = new OpenPgpKeyManagement(); var publicKeys = directory.Select(file => keyManagement.LoadPublicKey(file.CreateReadStream())); services.AddSingleton(LoadPublicKeys(publicKeys)); return(services); }
public HttpDirectoryContentDescriptor(IDirectoryContents directoryContent, Func <string, string> physicalPathResolver) { Exists = directoryContent.Exists; FileDescriptors = directoryContent.Select(_ => new HttpFileDescriptor(_, physicalPathResolver)); }