CertMgr Configuration
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.CertMgr Configuration Settings
CertComment: A comment to include in a saved certificate.This settings specified the comment to use when calling SaveCertificate. This can only be used when CertificateOutputFormat is set to a value other than the default value. When CertificateOutputFormat is set to "SSH2PublicKey" the value of this setting should be the full header. For instance: "Comment: My Comment". | |||||||||||||||||
CertCustomExtensionCount:
The number of records in the CertCustomExtension arrays.This property controls the size of the following arrays:
The array indices start at 0 and end at CertExtensionCount-1. | |||||||||||||||||
CertCustomExtensionCritical[i]:
Whether or not the extension is defined as critical.Whether or not the certificate extension at index 'i' is defined as critical.
Valid array indices are from 0 to CertCustomExtensionCount - 1. | |||||||||||||||||
CertCustomExtensionOID[i]:
The ASN of the extension at index 'i'.The ASN.1 Object-Identifier (OID) that defines the certificate extension at index 'i'.
Valid array indices are from 0 to CertCustomExtensionCount - 1. | |||||||||||||||||
CertCustomExtensionValue[i]:
The raw value of the extension at index 'i'.The raw value of this certificate extension (as a byte string). This value is encoded
according to the extension's ASN.1 specification.
Valid array indices are from 0 to CertCustomExtensionCount - 1. | |||||||||||||||||
CertificateOutputFormat:
The format of the certificate to save.By default when SaveCertificate is called the certificate will be
written in a PEM format. The format may be changed by setting CertificateOutputFormat to
one of the following values:
| |||||||||||||||||
CertKeyLength: The public key length for created certificates and keys.When CreateCertificate creates a new certificate and associated key, or when CreateKey creates a key, this setting determines the length of the new public key (in bits). The default value is 1024. | |||||||||||||||||
CertKeyType: The types of keys created for new certificates.When CreateCertificate creates a new certificate and associated key, or when CreateKey creates a key, this setting determines the type of key generated: 1 for key exchange (encryption) keys, and 2 for digital signature keys. The default value is 1. | |||||||||||||||||
CertPublicKeyAlgorithm:
The public key algorithm used when a certificate is created.When CreateCertificate creates a new certificate and associated key,
this setting determines the public key algorithm of the generated keys.
Valid values are:
| |||||||||||||||||
CertSignatureAlgorithm:
The signature algorithm used when creating certificates.When CreateCertificate or IssueCertificate creates a new certificate,
the signature algorithm used is specified by this setting. Possible values are:
| |||||||||||||||||
CertValidityTime:
The validity period for the certificate.This configuration setting determines the duration in days that a newly
created certificate remains valid. The certificate becomes valid
as soon as it is created, unless CertValidityOffset is set.
The duration is not changed if CertValidityOffset is set;
the certificate will still expire CertValidityTime days after the
validity period begins. The default value is 365 days.
| |||||||||||||||||
CertValidityOffset: The number of days until the certificate becomes valid.This configuration setting can be used to change when a newly created certificate becomes valid. By default, the certificate is valid as soon as it is created. Set CertValidityOffset to the number of days that this starting period should be offset from the current day. This setting also accepts negative values for back-dating the validity of a certificate. The default value is 0. | |||||||||||||||||
CSP: The Cryptographic Service Provider.The name of the Cryptographic Service Provider used to provide access to certificate signing operations. | |||||||||||||||||
CSRIgnoredExtensions:
Extensions to be ignorned when signing a CSR.Set this configuration setting to a comma separated list of OID's of any extensions already present in the CSR that should be ignored when the CSR is signed.
For example if the SAN's in a CSR should be ignored the below code would work:
CertMgr1->Config("CSRIgnoredExtensions=2.5.29.17");
| |||||||||||||||||
ExportedCert: The exported certificate file.This setting holds the certificate data that is exported when ExportCertificate is called with an empty CertFile parameter. If ExportFormat is set to "PFX" this setting holds the hex encoded PFX file data. If ExportFormat is set to any other value this holds the raw certificate content (not encoded). | |||||||||||||||||
ExportFormat:
The format of the exported certificate.By default when ExportCertificate is called the certificate will be written as a PFX file. The
format of the exported certificate may be changed by setting ExportFormat to one of the following values:
Note: On Linux/Unix the PFX/PKCS12 format is not supported. On Unix/Linux the default format is "PEM". Note: ExportCertificate is not support on macOS. | |||||||||||||||||
ImportCertAction:
Specified the action to take if a matching certificate or a link to a matching certificate already exists.When calling ImportCertificate if a matching certificate or a link to a matching certificate already exists
in the Windows certificate store this setting governs what action will be taken. Possible values are:
| |||||||||||||||||
ImportCertStoreType:
The type of certificate store being specified for import.When calling ImportCertificate, this value controls the type of the certificate store being specified in the first parameter.
This config can take one of the following values:
| |||||||||||||||||
JWKAlgorithm:
The JWK algorithm.This setting specifies the JWK algorithm. It can be set before calling ExportCertificate (if ExportFormat is set to JWK) or SaveCertificate (if CertificateOutputFormat is set to JWK) to control the key Id used to create the JWK. It will be populated if a JWK-formatted is loaded into the class.
Valid values are:
| |||||||||||||||||
JWKKeyId: The JWK key Id.This setting specifies the JWK key Id. It can be set before calling ExportCertificate (if ExportFormat is set to JWK) or SaveCertificate (if CertificateOutputFormat is set to JWK) to control the key Id used to create the JWK. It will be populated if a JWK-formatted is loaded into the class. | |||||||||||||||||
JWKKeyOps:
The JWK intended key operations list.This setting specifies the intended key operations for the JWK. It can be set before calling ExportCertificate (if ExportFormat is set to JWK) or SaveCertificate (if CertificateOutputFormat is set to JWK) to control the key Id used to create the JWK. It will be populated if a JWK-formatted is loaded into the class.
This setting format is a JSON array. Examples: ["sign","verify"] or ["encrypt"]. | |||||||||||||||||
JWKUse:
The JWK use parameter value.This setting specifies the JWK key Id. It can be set before calling ExportCertificate (if ExportFormat is set to JWK) or SaveCertificate (if CertificateOutputFormat is set to JWK) to control the key Id used to create the JWK. It will be populated if a JWK-formatted is loaded into the class.
Valid values are enc and sig. | |||||||||||||||||
KeyFormat:
How the public and private key are formatted.This setting controls the format of CertPublicKey and CertPrivateKey. By default
these properties hold PEM formatted public and private key data. When set to 1 (XML) the keys
are stored in a XML format. This only affects the values returned by the class; the actual keys remain
the same regardless of this setting. Possible values are:
| |||||||||||||||||
ReplaceKey: Whether or not to replace an existing key when creating a new key.If this is false (default), the component will throw an error if a duplicate key exists while generating a new keyset using CreateKey. If set to true, the component will replace a key if it already exists when generating new keys. | |||||||||||||||||
RequestSubjectAltNames:
Subject Alternative Names for a Certificate Signing Request.
This allows Subject Alternative Names to be added to a Certificate Signing request. The setting only supports
email, DNS, URI, and IPv4 addresses. Separate alternative names should be separated by commas. For example:
string altNames = "email:copy,dns:domain.com,dns.1:other.domain.com,uri:http://www.domain.com,ip:192.168.1.102"
| |||||||||||||||||
SavedCert: The saved certificate file.This setting holds the certificate data that is saved when SaveCertificate is called with an empty FileName parameter. If CertificateOutputFormat is set to "P7B" this setting holds the hex encoded P7B file data. If CertificateOutputFormat is set to any other value this holds the raw certificate content (not encoded). |
Base Configuration Settings
SelectWaitMillis: The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.If there are no events to process when DoEvents is called, the class will wait for the amount of time specified here before returning. The default value is 20. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodePage:
The system code page used for Unicode to Multibyte translations.The default code page is the Active Code Page (0).
The following is a list of valid code page identifiers:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UseInternalSecurityAPI: Tells the class whether or not to use the system security libraries or an internal implementation. By default the class will use the system security libraries to perform cryptographic functions. Setting this to True tells the class to use the internal implementation instead of using the system's security API. |