Back to product page

Import method


Imports (one or more) certificates from a file.

Type

A Certificate object. Full path to a file on local system.

Syntax

  • Basic
object.Import (Filename)
The Import(object,Filename) syntax has these parts:
objectA Certificate object. Full path to a file on local system.
FilenameRequired. A String value. Path to a file where certificates were exported.

Remarks

Import method will load one or more X509 certificates from a file to local collection. File should contain x509 certificates, and will look similar to this:

/DC=com/DC=microsoft/CN=Microsoft Root Certificate Authority
-----BEGIN CERTIFICATE-----
MIIFmTCCA4GgAwIBAgIQea0WoUqgpa1Mc1j0BxMuZTANBgkqhkiG9w0BAQUFADBf
.......
SSbd3ik1h/UwcXBbFDxpvYkSfesuo/7Yf56CWlIKK8FDK9kwiJ/IEPuJjeahhXUz
fmye23MTZGJppS99ypZtn/gETTCSPW4hFCHJPeDD/YprnUr90aGdmUN3P7Da
-----END CERTIFICATE-----

/OU=Copyright (c) 1997 Microsoft Corp./OU=Microsoft Corporation/CN=Microsoft Root Authority
-----BEGIN CERTIFICATE-----
MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAx
KzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAc
-----END CERTIFICATE-----
......


Import method will also allow PKCS12 PFX files to be imported this way.

For example, to import PFX file and then export it to X509 format, you can use simple code like this:
 
   Dim c As New Certificates
   c.Import "C:\somefile.pfx"
   c.Export "C:\certs.txt"
 

Now 'certs.txt' can be used from within any component that needs to load certificates from external source (such as wodHttpDLX'es LocalCertBag property).

Platforms

Windows