Imports an X.509 certificate to the certificate store.
Syntax:
Set <oCertificate> = object. ImportCertificate(<sCertificateFile>, [<sServiceProvider>], [<lProviderType>])
Parameters:
Returns
Returns an object of type FREDI.ediSecurityCertificate if imported successfully; otherwise NULL or an empty object is returned.
Remarks
This method imports certificates in the following format:
The default certificate store is specified by the properties DefaultCertSystemStoreName and DefaultCertSystemStoreLocation.
The sServiceProvider and lProviderType specify the CSP whose security services will be used. If sServiceProvider and/or lProviderType are not specified, the default CSP database is used, which is specified by DefaultProviderName andServiceProviderType.
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 default certificate store
oSecurities.DefaultCertSystemStoreName = "My" ' Case sensitive
' Set the default certificate store location
oSecurities.DefaultCertSystemStoreLocation = "CurrentUser"
' Test certificate created successfully.
' Import test certificate to default certificate store.
Dim oCertificate As Fredi.ediSecurityCertificate
Set oCertificate = oSecurities.ImportCertificate(App.Path & "\MyCertificate.cer")
If Not oCertificate Is Nothing Then
MsgBox "Successfully imported test certificate 'Edidev Test Certificate'."Else
MsgBox "Failed to import extended certificate"End If
Sample