All Products
Search
Document Center

Key Management Service:setAttribute

Last Updated:Mar 31, 2026

Use setAttribute to change the label, encrypt, decrypt, wrap, unwrap, sign, verify, derive, trusted, destroyable, wrap-with-trusted, wrap-template, and unwrap-template attributes of a key in the HSM.

Prerequisites

Before you begin, ensure that you have:

  • Started hsm_mgmt_tool

  • Logged in to the HSM

  • A user type that is authorized to run this command (see User types)

User types

The following user type can run this command. For a description of each role, see HSM User Permissions Table.

  • Administrator (CO)

Syntax

Because this command does not have named parameters, you must enter the arguments in the order shown.

setAttribute <key handle> <attribute id>

Example

This example disables the decrypt capability of key 6 (with the property constant 261) by setting it to 0.

cloudmgmt>setAttribute 6 261 0
*************************CAUTION********************************
This is a CRITICAL operation, should be done on all nodes in the
cluster. Cav server does NOT synchronize these changes with the
nodes on which this operation is not executed or failed, please
ensure this operation is executed on all nodes in the cluster.
****************************************************************

Do you want to continue(y/n)?y
setAttribute success on server 0(172.16.0.2)
Important

This is a critical operation. Run it on every node in the cluster. The server does not synchronize the change to nodes where the operation was not run or failed.

Parameters

ParameterRequiredDescriptionValid values
<key handle>YesThe handle of the key to modify. To list available keys and their handles, use listAttributes.No special requirements
<attribute id>YesThe attribute constant of the key attribute to change. To view all attribute constants and their values, use listAttributes. For details on each attribute, see Key Attribute Constants.See Valid attribute IDs

Valid attribute IDs

ConstantAttribute
3OBJ_ATTR_LABEL
134OBJ_ATTR_TRUSTED
260OBJ_ATTR_ENCRYPT
261OBJ_ATTR_DECRYPT
262OBJ_ATTR_WRAP
263OBJ_ATTR_UNWRAP
264OBJ_ATTR_SIGN
266OBJ_ATTR_VERIFY
268OBJ_ATTR_DERIVE
370OBJ_ATTR_DESTROYABLE
528OBJ_ATTR_WRAP_WITH_TRUSTED
1073742353OBJ_ATTR_WRAP_TEMPLATE
1073742354OBJ_ATTR_UNWRAP_TEMPLATE