ChilkatCertStore ActiveX Reference (Visual Basic)

ChilkatCertStore

* This is a freeware class/component/library.

Represents a certificate store. The certificate store can be registry-based, file-based, or in-memory. Allows certificates to be added, removed, or retrieved.

Properties

LastErrorHtml As String (read-only)

Error information in HTML format for the last method called.

LastErrorText As String (read-only)

Error information in plain-text format for the last method called.

LastErrorXml As String (read-only)

Error information in XML format for the last method called.

LinkForSigning As Long

To be documented soon...

NumCertificates As Long (read-only)

The number of certificates held in the certificate store.

NumEmailCerts As Long (read-only)

The number of certificates that can be used for sending secure email within this store.

Version As String (read-only)

The version of this component, such as "1.0"

Methods

AddCertificate(cert As ChilkatCert)

Adds a certificate to the store. If the certificate is already in the store, it is updated with the new information.

CreateFileStore(filename As String) As Long

To be documented soon...

CreateMemoryStore() As Long

To be documented soon...

CreateRegistryStore(regRoot As String, regPath As String) As Long

To be documented soon...

FindCertByRfc822Name(name As String) As ChilkatCert

Locates a certificate by its RFC 822 name and returns it if found. Otherwise returns NULL.

FindCertBySerial(serialNumber As String) As ChilkatCert

Finds and returns the certificate that has the matching serial number.

FindCertBySubject(str As String) As ChilkatCert

Finds a certificate where one of the Subject properties (SubjectCN, SubjectE, SubjectO, SubjectOU, SubjectL, SubjectST, SubjectC) matches exactly (but case insensitive) with the passed string. A match in SubjectCN will be tried first, followed by SubjectE, and SubjectO. After that, the first match found in SubjectOU, SubjectL, SubjectST, or SubjectC, but in no guaranteed order, is returned. All matches are case insensitive.

FindCertBySubjectCN(commonName As String) As ChilkatCert

Finds a certificate where the SubjectCN property (common name) matches exactly (but case insensitive) with the passed string.

FindCertBySubjectE(emailAddress As String) As ChilkatCert

Finds a certificate where the SubjectE property (email address) matches exactly (but case insensitive) with the passed string. This function differs from FindCertForEmail in that the certificate does not need to match the ForSecureEmail property.

FindCertBySubjectO(organization As String) As ChilkatCert

Finds a certificate where the SubjectO property (organization) matches exactly (but case insensitive) with the passed string.

FindCertForEmail(emailAddress As String) As ChilkatCert

Finds a certificate that can be used to send secure email to the passed email address. A certificate matches only if the ForSecureEmail property is TRUE, and the email address matches exactly (but case insensitive) with the SubjectE property. Returns NULL if no matches are found.

GetCertificate(index As Long) As ChilkatCert

Returns the Nth certificate in the store. The first certificate is at index 0.

GetEmailCert(index As Long) As ChilkatCert

Returns the Nth email certificate in the store. The first certificate is at index 0. Use the NumEmailCertificates property to get the number of email certificates.

LoadPfxData(pfxData As Variant, password As String) As Long

To be documented soon...

LoadPfxFile(pfxFilename As String, password As String) As Long

To be documented soon...

OpenChilkatStore(readOnly As Long) As Long

To be documented soon...

OpenCurrentUserStore(readOnly As Long) As Long

To be documented soon...

OpenFileStore(filename As String, readOnly As Long) As Long

To be documented soon...

OpenLocalSystemStore(readOnly As Long) As Long

To be documented soon...

OpenOutlookStore(readOnly As Long) As Long

To be documented soon...

OpenRegistryStore(regRoot As String, regPath As String, readOnly As Long) As Long

To be documented soon...

RemoveCertificate(cert As ChilkatCert)

Removes the passed certificate from the store. The certificate object passed as the argument can no longer be used once removed.

SaveLastError(filename As String)

Saves the last error information to an XML formatted file.