UpdateAlias Method

Updates an alias to refer to a different CMK.

Syntax

int UpdateAlias(const QString& qsAliasName, const QString& qsNewKeyId);

Remarks

This method updates the alias named AliasName, changing it so that it refers to the CMK specified by NewKeyId.

The value passed for the AliasName parameter must include the alias/ prefix, and must be the name of an alias in the current account and Region

The value passed for the NewKeyId parameter must be the Id or ARN of a CMK in the current account and Region. The specified CMK must be of the same type (i.e., symmetric or asymmetric) and have the same usage (i.e., encryption/decryption or signing/verification) as the CMK that the alias currently refers to.

This method will fail if the specified alias is AWS-managed (i.e., its name begins with alias/aws/). This method will also fail if the specified CMK's state is aksPendingDeletion (2), or if it is AWS-managed (see KeyAWSManaged).

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.)

Copyright (c) 2022 /n software inc. - All rights reserved.
Cloud Keys 2020 Qt Edition - Version 20.0 [Build 8157]