Generates a new CSR to be sent to a signing authority.
ANSI (Cross Platform) char* GenerateCSR(const char* lpszCertSubject, const char* lpszKeyName); Unicode (Windows) LPWSTR GenerateCSR(LPCWSTR lpszCertSubject, LPCWSTR lpszKeyName);
- (NSString*)generateCSR:(NSString*)certSubject :(NSString*)keyName;
#define MID_CERTMGR_GENERATECSR 8 IPWORKSSFTP_EXTERNAL int IPWORKSSFTP_CALL IPWorksSFTP_CertMgr_Do(void *lpObj, int methid, int cparam, void *param, int cbparam, int64 *lpllVal);
This method will generate a new Certificate Signing Request (CSR) to be sent to the signing authority. CertSubject specifies the subject of the Certificate Signing Request (CSR). KeyName specifies the name of the keyset (public/private key pair) to be used. If the keyset does not already exist in the Cryptographic Service Provider (CSP), the class will automatically generate one. To set the CSP, use the CSP configuration setting.
NOTE: it is important to remember the name of the keyset that is used when creating a CSR, as keyset must be later re-associated with the certificate after the trust authority has signed the CSR.
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.
NOTE: This functionality is only available in Windows.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its 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.