[VB6 equivalent: X509_MakeCert
]
Dim nRet As Integer
Dim strNewCertFile As String
Dim strIssuerCert As String
Dim strSubjectPubKeyFile As String
Dim strIssuerPriKeyFile As String
Dim strPassword As String
Dim nCertNum As Integer
Dim nYearsValid As Integer
Dim strDistName As String
Dim strEmail As String
strNewCertFile = "myuser.cer"
strIssuerCert = "myca.cer"
strSubjectPubKeyFile = "mykey.pub"
strIssuerPriKeyFile = "myca.p8e"
strPassword = "password" '!!
nCertNum = &H101
nYearsValid = 4
strDistName = "CN=My User,O=Test Org,OU=Unit,C=AU,L=My Town,S=State,E=myuser@testorg.com"
strEmail = "myuser@testorg.com"
nRet = X509.MakeCert(strNewCertFile, strIssuerCert, strSubjectPubKeyFile, strIssuerPriKeyFile, _
nCertNum, nYearsValid, strDistName, strEmail, 0, strPassword, SigAlgorithm.Rsa_Sha1, X509.CertOptions.Default)
If nRet <> 0 Then
Console.WriteLine(nRet & " " & General.LastError())
Else
Console.WriteLine("Success, created X.509 cert " & strNewCertFile)
End If
See Also:
X509.MakeCert Method