Exemplo n.º 1
0
 public EnController(CreateCertificates createCertificates, ImportExportCertificate importExportCertificate, SymmetricEncryptDecrypt symmetricEncryptDecrypt,
                     AsymmetricEncryptDecrypt asymmetricEncryptDecrypt)
 {
     _createCertificates       = createCertificates;
     _importExportCertificate  = importExportCertificate;
     _symmetricEncryptDecrypt  = symmetricEncryptDecrypt;
     _asymmetricEncryptDecrypt = asymmetricEncryptDecrypt;
 }
Exemplo n.º 2
0
 public EncryptTextModel(SymmetricEncryptDecrypt symmetricEncryptDecrypt,
                         AsymmetricEncryptDecrypt asymmetricEncryptDecrypt,
                         ApplicationDbContext applicationDbContext,
                         ImportExportCertificate importExportCertificate)
 {
     _symmetricEncryptDecrypt  = symmetricEncryptDecrypt;
     _asymmetricEncryptDecrypt = asymmetricEncryptDecrypt;
     _applicationDbContext     = applicationDbContext;
     _importExportCertificate  = importExportCertificate;
 }
 public DecryptTextModel(SymmetricEncryptDecrypt symmetricEncryptDecrypt,
                         AsymmetricEncryptDecrypt asymmetricEncryptDecrypt,
                         ApplicationDbContext applicationDbContext,
                         ImportExportCertificate importExportCertificate,
                         DigitalSignatures digitalSignatures,
                         IConfiguration configuration)
 {
     _symmetricEncryptDecrypt  = symmetricEncryptDecrypt;
     _asymmetricEncryptDecrypt = asymmetricEncryptDecrypt;
     _applicationDbContext     = applicationDbContext;
     _importExportCertificate  = importExportCertificate;
     _digitalSignatures        = digitalSignatures;
     _configuration            = configuration;
 }
Exemplo n.º 4
0
 public RegisterModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender,
     CreateCertificates createCertificates,
     ImportExportCertificate importExportCertificate)
 {
     _userManager             = userManager;
     _signInManager           = signInManager;
     _logger                  = logger;
     _emailSender             = emailSender;
     _createCertificates      = createCertificates;
     _importExportCertificate = importExportCertificate;
 }
Exemplo n.º 5
0
        public void CreateCert()
        {
            ServiceProvider sp = new ServiceCollection()
                                 .AddCertificateManager()
                                 .BuildServiceProvider();

            _cc = sp.GetService <CreateCertificates>();

            X509Certificate2 oldRsaCert = CreateRsaCertificate("localhost_IS_test_old", 1);

            X509Certificate2 rsaCert = CreateRsaCertificate("localhost_IS_test", 10);

            string password             = "******";
            ImportExportCertificate iec = sp.GetService <ImportExportCertificate>();

            RsaCertPfxBytes =
                iec.ExportSelfSignedCertificatePfx(password, rsaCert);
            byte[] OldRsaCertPfxBytes =
                iec.ExportSelfSignedCertificatePfx(password, oldRsaCert);

            Certificate = new X509Certificate2(RsaCertPfxBytes, password);

            OldCertificate = new X509Certificate2(OldRsaCertPfxBytes, password);
        }
Exemplo n.º 6
0
 public CertificateCryptoServices(CreateCertificates createCertificates, ImportExportCertificate importExportCertificate)
 {
     _createCertificates      = createCertificates;
     _importExportCertificate = importExportCertificate;
 }