Code: Select all
ApplicationInstance.Default.ApplicationCertificate.ValidTo = DateTime.Now.AddYears(10);
// setting this flag will create the certificate automatically if it does not already exist,
// however, the process must be running with administrative priviledges. If this flag is false
// the certificate has to be created manually by another tool or by running this process once
// with administrative priviledges and the /install argument.
ApplicationInstance.Default.AutoCreateCertificate = true;
I was wondering how I could have customized the certificate's duration. UaSchema has a "ValidTo" property (first line) but I cannot set it like that from code.
Any advice about how to do it in this scenario?