All Products
Search
Document Center

Key Management Service:setAttribute

Last Updated:Mar 31, 2026

Use setAttribute to convert a session key into a persistent key. A persistent key remains in the Hardware Security Module (HSM) until you explicitly delete it.

The command converts the key by changing its token attribute (OBJ_ATTR_TOKEN) from false (0) to true (1).

Prerequisites

Before you begin, make sure that you have:

Syntax

setAttribute -o <object handle>
             -a 1
Important

Enter parameters in the exact order shown in the syntax.

Parameters

ParameterDescriptionRequiredValid values
-oThe key handle of the session key to convert. To find the key handle, run findKey.YesAny valid session key handle
-aThe attribute constant to change. The only valid value is 1, which targets the token attribute (OBJ_ATTR_TOKEN).Yes1

Example

The following example converts the session key with handle 21 into a persistent key.

Command:  setAttribute -o 21 -a 1
                This attribute is defined as a boolean value.
                Enter the boolean attribute value (0 or 1):1

        Cfm3SetAttribute returned: 0x00 : HSM Return: SUCCESS

        Cluster Status:
        Node id 0 status: 0x00000000 : HSM Return: SUCCESS

A return code of 0x00 confirms the operation succeeded. The key is now persistent and remains in the HSM until deleted.