예제 #1
0
        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);
        }
예제 #2
0
 public HttpDirectoryContentDescriptor(IDirectoryContents directoryContent,
                                       Func <string, string> physicalPathResolver)
 {
     Exists          = directoryContent.Exists;
     FileDescriptors = directoryContent.Select(_ => new HttpFileDescriptor(_, physicalPathResolver));
 }