Hi @Eng Ahmed ,
You could try this to general the CSR.
Private Sub SurroundingSub()
Dim rsa As Chilkat.Rsa = New Chilkat.Rsa()
Dim success As Boolean = rsa.GenerateKey(2048)
If success <> True Then
Console.WriteLine(rsa.LastErrorText)
Return
End If
Dim privKey As Chilkat.PrivateKey = rsa.ExportPrivateKeyObj()
Dim csr As Chilkat.Csr = New Chilkat.Csr()
csr.CommonName = "mysubdomain.mydomain.com"
csr.Country = "GB"
csr.State = "Yorks"
csr.Locality = "York"
csr.Company = "Internet Widgits Pty Ltd"
csr.CompanyDivision = "IT"
csr.EmailAddress = "******@mydomain.com"
Dim pemStr As String = csr.GenCsrPem(privKey)
If csr.LastMethodSuccess <> True Then
Console.WriteLine(csr.LastErrorText)
Return
End If
privKey.SavePkcs8EncryptedPemFile("password", "qa_output/privKey1.pem")
Dim fac As Chilkat.FileAccess = New Chilkat.FileAccess()
fac.WriteEntireTextFile("qa_output/csr1.pem", pemStr, "utf-8", False)
Console.WriteLine(pemStr)
End Sub
Best regards,
Yijing Sun
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.