Creates a new self-signed certificate in the current store.
ANSI (Cross Platform) int CreateCertificate(const char* lpszCertSubject, int iSerialNumber); Unicode (Windows) INT CreateCertificate(LPCWSTR lpszCertSubject, INT iSerialNumber);
- (void)createCertificate:(NSString*)certSubject :(int)serialNumber;
#define MID_CERTMGR_CREATECERTIFICATE 3 IPWORKSSMIME_EXTERNAL int IPWORKSSMIME_CALL IPWorksSMIME_CertMgr_Do(void *lpObj, int methid, int cparam, void *param, int cbparam, int64 *lpllVal);
This method creates a new self-signed certificate in the current store, containing the following:
CertSubject specifies the subject of the new certificate. A new keyset (public/private key pair) is generated and associated with the new certificate.
The certificate subject is a comma separated list of distinguished name fields and values. For instance "CN=www.server.com, OU=test, C=US, Efirstname.lastname@example.org". Common fields and their meanings are displayed below.
|CN||Common Name. This is commonly a host name like www.server.com.|
If a field value contains a comma it must be quoted.
SerialNumber specifies the certificate serial number. All certificates signed by the same issuer must have different (unique) serial numbers.
In the Unix edition of the toolkit the certificate will be created in memory. Call ExportCertificate to export the newly created certificate to a PEM file.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)