Cloud Keys 2020 Node.js Edition

Questions / Feedback?

UpdateKey Method

Updates a key's information.


azurekeys.updateKey(keyName, keyOps, updateTags, [callback])


The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:



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
(Note that EC keys can only be used for signing and verification.)

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.

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