Determines if an X.509 certificate exists in the default certificate store.
Syntax:
<True/False> = object. IsCertificateExists(<sSubjectName>, [<sServiceProvider>], [<lProviderType>])
Parameters:
Returns
Returns 1 if the certificate is found; otherwise 0 if not found.
Remarks:
The certificate is searched in the current certificate store and store location.
To change the default certificate store location use the DefaultCertSystemStoreLocation property.
To change the default certificate store use the DefaultCertSystemStoreName property.
Example:
Dim oEdiDoc As Fredi.ediDocument
Dim oSecurities As Fredi.ediSecurities
' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument
' Get securities object.
Set oSecurities = oEdiDoc.GetSecurities
' Set the store location.
oSecurities.DefaultCertSystemStoreLocation = "CurrentUser"
' Set the store name.
oSecurities.DefaultCertSystemStoreName = "My"
Dim sCertName As String
sCertName = "EDIDEV SRV DEMO COMPANY"
If oSecurities.IsCertificateExists(sCertName) Then
MsgBox "Certificate " & sCertName & " found."
Else
MsgBox "Certificate " & sCertName & " not found."
End If
Sample