Creates a PKCS-10 certification signing request (CSR).
VB6/VBA
Debug.Print "Testing X509_CertRequest ..."
Dim nRet As Long
nRet = X509_CertRequest("pkcs_ex_req.bin", "rsa508.epk", _
"C=US,O=Example Organization,CN=Test User 1", "", "password", _
PKI_SIG_MD2RSA + PKI_X509_FORMAT_BIN + PKI_X509_REQ_KLUDGE)
If nRet <> 0 Then
Debug.Print nRet & " " & pkiGetLastError()
Else
Debug.Print "Success"
End If
Output
Testing X509_CertRequest ... Success
VB.NET
Console.WriteLine("Testing X509_CertRequest ...")
Dim nRet As Integer
nRet = X509.CertRequest("pkcs_ex_req.bin", "rsa508.epk", _
"C=US,O=Example Organization,CN=Test User 1", "password", _
X509.Options.SigAlg_Md2WithRSAEncryption Or X509.Options.FormatBinary Or X509.Options.RequestKludge)
If nRet <> 0 Then
Console.WriteLine(nRet & " " & General.LastError())
Else
Console.WriteLine("Success")
End If
[Contents]