CkCertStore C++ Class Reference (Visual C++)
CkCertStore
* 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
void LastErrorHtml(CkString &str);
Error information in HTML format for the last method called.
void LastErrorText(CkString &str);
Error information in plain-text format for the last method called.
void LastErrorXml(CkString &str);
Error information in XML format for the last method called.
long get_NumCertificates(void);
The number of certificates held in the certificate store.
long get_NumEmailCerts(void);
The number of certificates that can be used for sending secure email within this store.
bool get_Utf8(void) const; void put_Utf8(bool b);
When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.
void get_Version(CkString &version);
The version of this component, such as "1.0"
Methods
bool AddCertificate(const CkCert * cert);
Adds a certificate to the store. If the certificate is already in the store, it is updated with the new information.
bool AddCertificate(const CkCert & cert);
Adds a certificate to the store. If the certificate is already in the store, it is updated with the new information.
CkCert * FindCertBySerial(const char * serialNumber);
Finds and returns the certificate that has the matching serial number.
CkCert * FindCertBySubject(const char * subject);
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.
CkCert * FindCertBySubjectCN(const char * commonName);
Finds a certificate where the SubjectCN property (common name) matches exactly (but case insensitive) with the passed string.
CkCert * FindCertBySubjectE(const char * emailAddress);
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.
CkCert * FindCertBySubjectO(const char * organization);
Finds a certificate where the SubjectO property (organization) matches exactly (but case insensitive) with the passed string.
CkCert * FindCertForEmail(const char * emailAddress);
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.
CkCert * GetCertificate(long index);
Returns the Nth certificate in the store. The first certificate is at index 0.
CkCert * GetEmailCert(long index);
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.
bool LoadPfxData(CkByteData & pfxData, const char * password);
To be documented soon...
bool LoadPfxData2(const unsigned char * buf, unsigned long bufLen, const char * password);
To be documented soon...
bool LoadPfxFile(const char * filename, const char * password);
To be documented soon...
bool RemoveCertificate(const CkCert * cert);
Removes the passed certificate from the store. The certificate object passed as the argument can no longer be used once removed.
bool RemoveCertificate(const CkCert & cert);
Removes the passed certificate from the store. The certificate object passed as the argument can no longer be used once removed.
bool SaveLastError(const char * filename);
Saves the last error information to an XML formatted file.
const char * lastErrorHtml();
Error information in HTML format for the last method called.
const char * lastErrorText();
Error information in plain-text format for the last method called.
const char * lastErrorXml();
Error information in XML format for the last method called.
const char * version();
The version of this component, such as "1.0"
|