SignRequest() public method

public SignRequest ( string csrFile, Usage usage, int validity ) : X509Certificate2
csrFile string
usage Usage
validity int
return System.Security.Cryptography.X509Certificates.X509Certificate2
Beispiel #1
0
        static void Main(string[] args)
        {
            try
            {
                ShowInformation();
                ProgramOptions options = ParseCommandLine(args);
                if (options == null)
                {
                    return;
                }

                StoreLocation store = options.MachineStore ? StoreLocation.LocalMachine : StoreLocation.CurrentUser;

                CertificatesAuthority ca = new CertificatesAuthority(options.AuthorityName, store);
                if (options.Pkcs10File != null)
                {
                    ca.SignRequest(options.Pkcs10File, options.Usage, 0);
                }
                else
                {
                    ca.GenerateCertificate(options.CertificateName, options.Usage, 0);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            try
            {
                ShowInformation();
                ProgramOptions options = ParseCommandLine(args);
                if(options == null)
                    return;

                StoreLocation store = options.MachineStore ? StoreLocation.LocalMachine : StoreLocation.CurrentUser;

                CertificatesAuthority ca = new CertificatesAuthority(options.AuthorityName, store);
                if(options.Pkcs10File != null)
                    ca.SignRequest(options.Pkcs10File, options.Usage, 0);
                else
                    ca.GenerateCertificate(options.CertificateName, options.Usage, 0);
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }