UpdateKey Method
Updates a key's information.
Syntax
int UpdateKey(const QString& qsKeyName, const QString& qsKeyOps, bool bUpdateTags);
Remarks
This method updates the information for the key specified by KeyName. The VersionId configuration setting can be used to target a specific key version.
The KeyOps parameter, if non-empty, must be a comma-separated list of operations that the key is valid for. If empty, the key's current operations list remains unchanged. Possible values are as follows; operations should be specified in pairs:
- encrypt
- decrypt
- sign
- verify
- wrapKey
- unwrapKey
The UpdateTags parameter determines whether the class replaces the key's current tags with the items in the Tag* properties (which may be empty). Keys may have up to 15 tags.
The ExpiryDate and NotBeforeDate configuration settings may also be used to send additional values, refer to their documentation for more information.
Error Handling
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.)