CkCertStore Perl Programming Reference Documentation
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.
Object Creation
$obj = new chilkat::CkCertStore();
Properties
# str is a CkString object (output) LastErrorHtml( str )
Error information in HTML format for the last method called.
# str is a CkString object (output) LastErrorText( str )
Error information in plain-text format for the last method called.
# str is a CkString object (output) LastErrorXml( str )
Error information in XML format for the last method called.
# Returns an integer value get_NumCertificates( )
The number of certificates held in the certificate store.
# Returns an integer value get_NumEmailCerts( )
The number of certificates that can be used for sending secure email within this store.
# Returns a boolean value get_Utf8( )
# b is a boolean (input) put_Utf8( 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.
# version is a CkString object (output) get_Version( version )
The version of this component, such as "1.0"
Methods
# cert is a CkCert object (input) # Returns a boolean value AddCertificate( cert )
Adds a certificate to the store. If the certificate is already in the store, it is updated with the new information.
# filename is a string (input) # Returns a boolean value CreateFileStore( filename )
Creates a new file-based certificate store. Certificates may be saved to this store by calling AddCertificate. Returns 1 for success, 0 for failure.
# Returns a boolean value CreateMemoryStore( )
Creates an in-memory certificate store. Certificates may be added by calling AddCertificate. Returns 1 for success, 0 for failure.
# regRoot is a string (input) # regPath is a string (input) # Returns a boolean value CreateRegistryStore( regRoot, regPath )
Creates a registry-based certificate store. regRoot must be "CurrentUser" or "LocalMachine". regPath is a registry path such as "Software/MyApplication/Certificates". Returns 1 for success, 0 for failure.
# name is a string (input) # Returns a CkCert object FindCertByRfc822Name( name )
Locates a certificate by its RFC 822 name and returns it if found. Otherwise returns NULL.
# serialNumber is a string (input) # Returns a CkCert object FindCertBySerial( serialNumber )
Finds and returns the certificate that has the matching serial number.
# str is a string (input) # Returns a CkCert object FindCertBySha1Thumbprint( str )
Finds a certificate by it's SHA-1 thumbprint. The thumbprint is a hexidecimal string.
# subject is a string (input) # Returns a CkCert object FindCertBySubject( 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.
# commonName is a string (input) # Returns a CkCert object FindCertBySubjectCN( commonName )
Finds a certificate where the SubjectCN property (common name) matches exactly (but case insensitive) with the passed string.
# emailAddress is a string (input) # Returns a CkCert object FindCertBySubjectE( 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.
# organization is a string (input) # Returns a CkCert object FindCertBySubjectO( organization )
Finds a certificate where the SubjectO property (organization) matches exactly (but case insensitive) with the passed string.
# emailAddress is a string (input) # Returns a CkCert object FindCertForEmail( 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.
# index is an integer (input) # Returns a CkCert object GetCertificate( index )
Returns the Nth certificate in the store. The first certificate is at index 0.
# index is an integer (input) # Returns a CkCert object GetEmailCert( 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.
# pfxData is a CkByteData object (output) # password is a string (input) # Returns a boolean value LoadPfxData( pfxData, password )
Loads a PFX from an in-memory image of a PFX file. Returns 1 for success, 0 for failure.
# buf is a byte array (input) # bufLen is an integer (input) # password is a string (input) # Returns a boolean value LoadPfxData2( buf, bufLen, password )
Loads a PFX from an in-memory image of a PFX file. Returns 1 for success, 0 for failure.
# filename is a string (input) # password is a string (input) # Returns a boolean value LoadPfxFile( filename, password )
Loads a PFX file. Returns 1 for success, 0 for failure.
# readOnly is a boolean (input) # Returns a boolean value OpenChilkatStore( readOnly )
Opens the registry-based local machine certificate store having the path "Software/Chilkat/SystemCertificates". If the certificate store does not exist, it is automatically created. Set readOnly = 1 if you are only fetching certificates and not updating the certificate store (i.e. you are not adding or removing certificates). Setting readOnly = 1 will prevent many "permission denied" errors. Returns 1 for success, 0 for failure.
# readOnly is a boolean (input) # Returns a boolean value OpenCurrentUserStore( readOnly )
Opens the registry-based current-user certificate store. Set readOnly = 1 if you are only fetching certificates and not updating the certificate store (i.e. you are not adding or removing certificates). Setting readOnly = 1 will prevent many "permission denied" errors. Returns 1 for success, 0 for failure.
# filename is a string (input) # readOnly is a boolean (input) # Returns a boolean value OpenFileStore( filename, readOnly )
Opens a file-based certificate store. Returns 1 for success, 0 for failure.
# readOnly is a boolean (input) # Returns a boolean value OpenOutlookStore( readOnly )
Opens the registry-based certificate store used by Outlook. Set readOnly = 1 if you are only fetching certificates and not updating the certificate store (i.e. you are not adding or removing certificates). Setting readOnly = 1 will prevent many "permission denied" errors. Returns 1 for success, 0 for failure.
# regRoot is a string (input) # regPath is a string (input) # readOnly is a boolean (input) # Returns a boolean value OpenRegistryStore( regRoot, regPath, readOnly )
Opens an arbitrary registry-based certificate store. regRoot must be "CurrentUser" or "LocalMachine". regPath is a registry path such as "Software/MyApplication/Certificates". Returns 1 for success, 0 for failure.
# cert is a CkCert object (input) # Returns a boolean value RemoveCertificate( cert )
Removes the passed certificate from the store. The certificate object passed as the argument can no longer be used once removed.
# filename is a string (input) # Returns a boolean value SaveLastError( filename )
Saves the last error information to an XML formatted file.
# Returns a string lastErrorHtml( )
Error information in HTML format for the last method called.
# Returns a string lastErrorText( )
Error information in plain-text format for the last method called.
# Returns a string lastErrorXml( )
Error information in XML format for the last method called.
# Returns a string version( )
The version of this component, such as "1.0"
|