public X509Certificate2 GetVMCASignedCertificate(VMCAAdaptor.VMCA_PKCS_10_REQ_DATA certRequest, string privateKey, DateTime notBefore, DateTime notAfter) { IntPtr pCert = new IntPtr(); long nBefore = notBefore.ToTime_t(); long nAfter = notAfter.ToTime_t(); UInt32 dwError = VMCAAdaptor.VMCAGetSignedCertificateHA(_serverContext, ServerName, certRequest, privateKey, "", nBefore, nAfter, out pCert); VMCAError.Check(dwError); string certString = Marshal.PtrToStringAnsi(pCert); VMCAAdaptor.VMCAFreeCertificate(pCert); return(new X509Certificate2(ASCIIEncoding.ASCII.GetBytes(certString))); }
public VMCAAdaptor.VMCA_PKCS_10_REQ_DATA GetRequestData () { var req = new VMCAAdaptor.VMCA_PKCS_10_REQ_DATA (); req.pszName = Name; req.pszCountry = Country; req.pszLocality = Locality; req.pszState = State; req.pszOrganization = Organization; req.pszOU = OU; req.pszDNSName = DNSName; req.pszURIName = URIName; req.pszEmail = Email; req.pszIPAddress = IPAddress; req.dwKeyUsageConstraints = KeyUsageConstraints; return req; }
public VMCAAdaptor.VMCA_PKCS_10_REQ_DATA GetRequestData() { var req = new VMCAAdaptor.VMCA_PKCS_10_REQ_DATA(); req.pszName = Name; req.pszDomainName = DomainName; req.pszCountry = Country; req.pszLocality = Locality; req.pszState = State; req.pszOrganization = Organization; req.pszOU = OU; req.pszDNSName = DNSName; req.pszURIName = URIName; req.pszEmail = Email; req.pszIPAddress = IPAddress; req.dwKeyUsageConstraints = KeyUsageConstraints; return(req); }