Indicates if a key container exists in a Cryptographic Service Provider (CSP) database.
Syntax:
<True/False> = object. IsKeyContainerExists(<sKeyContainer>, [<sServiceProvider>], [< lProviderType>])
Parameters:
RemarksReturns TRUE if the key container is found; otherwise returns FALSE if not found.
If sServiceProvider and/or lProviderType are not specified, the default CSP database is used, which is specified by DefaultProviderName and ServiceProviderType. The type of database, whether machine key set or user key set, is specified using ediDocument.Option by the constant OptDocument_MachineKeySet.
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"
sCertName = "Test Certificate"
If oSecurities.IsCertificateExists(sCertName) Then
MsgBox "Certificate " & sCertName & " found."Else
MsgBox "Certificate " & sCertName & " not found."End If
Sample