Advtools.AdvInterceptor.CertificatesManager.StoreCertificate C# (CSharp) Method

StoreCertificate() private method

private StoreCertificate ( string name, byte raw, RSA key, System.Security.Cryptography.X509Certificates storeName, System.Security.Cryptography.X509Certificates location ) : void
name string
raw byte
key System.Security.Cryptography.RSA
storeName System.Security.Cryptography.X509Certificates
location System.Security.Cryptography.X509Certificates
return void
        private void StoreCertificate(string name, byte[] raw, RSA key, MSX509.StoreName storeName, MSX509.StoreLocation location)
        {
            PKCS12 p12 = BuildPkcs12(raw, key);

            MSX509.X509Certificate2 certificate = new MSX509.X509Certificate2(p12.GetBytes(), "advtools", MSX509.X509KeyStorageFlags.PersistKeySet | MSX509.X509KeyStorageFlags.MachineKeySet | MSX509.X509KeyStorageFlags.Exportable);

            MSX509.X509Store store = new MSX509.X509Store(storeName, location);
            store.Open(MSX509.OpenFlags.ReadWrite);
            store.Add(certificate);
            store.Close();

            certificates_[name] = certificate;
        }