--- title: "Unwrapping a Key" slug: "dsm-example-code-unwrapping-a-key" updated: 2026-06-09T15:06:50Z published: 2026-06-09T15:06:50Z canonical: "support.fortanix.com/dsm-example-code-unwrapping-a-key" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.fortanix.com/llms.txt > Use this file to discover all available pages before exploring further. # Unwrapping a Key This operation unwraps (decrypts) a wrapped key and import into Fortanix DSM. This allows securely importing into Fortanix DSM security objects that were previously wrapped by Fortanix DSM or another key management system. A new security object will be created in Fortanix DSM with the unwrapped data. - The `Alg` and `Mode` parameters specify the encryption algorithm and cipher mode being used by the unwrapping key (See Encryption Section). - The `ObjectType` parameter specifies the object type of the Security-object being unwrapped. The size or elliptic curve of the object being unwrapped does not need to be specified.     - [Go](/docs/dsm-example-code-unwrapping-a-key#tabs-1) - [Java](/docs/dsm-example-code-unwrapping-a-key#tabs-2) - [Python](/docs/dsm-example-code-unwrapping-a-key#tabs-3) - [REST API using curl](/docs/dsm-example-code-unwrapping-a-key#tabs-4)             ### Go         ```bash newKeyName := "new AES Key" unwrapKeyReq := sdkms.UnwrapKeyRequest {           Name: &newKeyName,           Alg: sdkms.AlgorithmRsa // Unwrapping key type           ObjType: sdkms.AlgorithmAes,           WrappedKey: new byte[](), } unwrapKeyResp, err := client.Unwrap(ctx, unwrapKeyReq) ```                 ### Java         ```bash // Unwrap an AES key that is wrapped with an RSA key UnwrapKeyRequest unwrapRequest = new UnwrapKeyRequest()              .ObjType(ObjectType.AES)              .name("new AES key")              .wrappedKey()              .alg(ObjectType.RSA); // Unwrapping key type               KeyObject unwrappedKey = new WrappingAndUnwrappingApi(apiClient)       .unwrapKey(, unwrapRequest); ```                 ### Python         ```bash #Unwrap an AES key that is wrapped with an RSA key api_instance = sdkms.v1.WrappingAndUnwrappingApi(api_client=client) request = sdkms.v1.UnwrapKeyRequest(      alg=ObjectType.RSA, // Unwrapping Key Type      obj_type=ObjectType.AES,      wrapped_key=      name="new AES KEY") wrapping_response = api_instance        .unwrap_key(/crypto/v1/unwrapkey -H 'Authorization: Bearer YhXwwa-6C...ig5g' -d '{"key": {"kid": "Unwrapping-Key-UUID"}, "alg": "RSA", "obj_type": "AES", "wrapped_key": "YiBmal…ZyB1eXZpZyB2ZQoK", "name": "new AES Key"}' ```     Fortanix Data Security Manager (DSM) is the world’s first cloud service secured with Intel® SGX. With Fortanix DSM, you can securely generate, store, and use cryptographic keys and certificates, as well as other secrets such as passwords, API keys, tokens, or any blob of data. Your business-critical applications and containers can integrate with Fortanix DSM using legacy cryptographic interfaces (PKCS#11, CNG, and JCE) or using the native Fortanix DSM RESTful interface. A security object is any datum stored in DSM (for example a key, a certificate, a password, or other security objects). Each security object is assigned to exactly one group. users and applications assigned to the group have permission to see the security object and to perform operations on it. ## Related - [Exporting a Security Object](/dsm-example-code-exporting-a-security-object.md) - [Command-Line Interface (CLI) for Fortanix DSM (sdkms-cli)](/fortanix-dsm-clients-command-line-interface-cli.md)