using Valg.EVA.Skanning.ContainerExtensions;
using Unity;
using Valg.EVA.Skanning.Configuration;

namespace Valg.EVA.Skanning.Signing
{
    public class UnityInstaller : IUnityInstaller
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        public void Install(IUnityContainer unityContainer)
        {
            unityContainer.RegisterType<ISignatureCryptographicServiceProvider, SignatureCryptographicServiceProvider>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<ICertificates, Certificates>(ContainerLifetimes.CreateContainerControlledLifetimeManager());            
            unityContainer.RegisterType<IPemSignatureValidator, PemSignatureValidator>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
        }
    }
}

