CreateKey Method
Creates an OpenPGP key pair.
Syntax
ANSI (Cross Platform) int CreateKey(const char* lpszUserId, const char* lpszPassphrase); Unicode (Windows) INT CreateKey(LPCWSTR lpszUserId, LPCWSTR lpszPassphrase);
- (void)createKey:(NSString*)userId :(NSString*)passphrase;
#define MID_KEYMGR_CREATEKEY 7 IPWORKSENCRYPT_EXTERNAL int IPWORKSENCRYPT_CALL IPWorksEncrypt_KeyMgr_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
This method creates a new OpenPGP key pair. The UserId parameter specifies the user Id of the key.
The UserId format is:
FirstName LastName (Comment) <Email>
Additional configuration settings may be set to further configure the details of the key being created. Please see the following settings for details:
- KeyEncryptionAlgorithm
- KeyUsage
- KeyValidityTime
- PublicKeyLength
- PublicKeyAlgorithm
- PublicKeySignatureHashAlgorithm
- Curve
- SubKeyCurve
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.)