我正在尝试使用x509Certificate
程序集创建新的Microsoft.Hpc.Scheduler.Store
:
string CAsubject = certSubject;
CX500DistinguishedName distinguishedName = new CX500DistinguishedName();
distinguishedName.Encode("CN=" + CAsubject, X500NameFlags.XCN_CERT_NAME_STR_NONE);
string strRfc822Name = certSubject;
CAlternativeName objRfc822Name = new CAlternativeName();
CAlternativeNames objAlternativeNames = new CAlternativeNames();
CX509ExtensionAlternativeNames objExtensionAlternativeNames = new CX509ExtensionAlternativeNames();
// Set Alternative RFC822 Name
objRfc822Name.InitializeFromString(AlternativeNameType.XCN_CERT_ALT_NAME_DNS_NAME, strRfc822Name);
// Set Alternative Names
objAlternativeNames.Add(objRfc822Name);
objExtensionAlternativeNames.InitializeEncode(objAlternativeNames);
最后一行抛出`System.ArgumentException:值不在预期范围内。为什么该方法引发此异常?