Example Code

Prev Next
  • Updated on Aug 19, 2026
  • Published on Jun 20, 2024
Fortanix-Data-Security-Manager ( DSM ) provides multiple interfaces to application developers. For C/C++ programmers, Fortanix DSM provides a PKCS#11 interface through a library. For Java programmers, Fortanix DSM can be accessed through the  ...
  • Updated on Dec 10, 2024
  • Published on May 30, 2024
Java Python REST API using curl Java GroupRequest request = new GroupRequest("My Encryption Group"); new GroupsApi(apiClient).createGroup(request); Python api_instance = sdkms.v1.GroupsApi(api_client=client) request = sdkm...
  • Updated on Dec 10, 2024
  • Published on May 30, 2024
The getSecurityObjects API returns a list of all security objects that the currently authorized entity can access. This supports some filter and sort parameters. C# Go Java Python REST API using curl C# SecurityObje...
  • Updated on Mar 10, 2026
  • Published on May 30, 2024
The first step is to configure the Fortanix-Data-Security-Manager ( DSM ) service endpoint to communicate with the Fortanix DSM service and authenticate with the service. The endpoint is the full Fortanix DSM cluster URL. For example, https://sm...
  • Updated on Apr 2, 2025
  • Published on Jun 3, 2024
1.0 AES Encryption Encryption using an AES Key requires the following parameters to be set: Alg : Same as the key type: AES Mode : One of the supported values: ECB, CBC, CBCNOPAD, CFB, CTR, OFB, GCM, CCM, KW, KWP IV : Initialization V...
  • Updated on Aug 26, 2026
  • Published on Jun 20, 2024
1.0 Overview The method used to configure authentication varies depending on what type of authentication you wish to perform. For more information, refer to Authentication . Every authentication creates a session that grants a bearer token ...
  • Updated on Aug 29, 2026
  • Published on Jun 20, 2024
1.0 Overview The following is an example of adding a simple quorum approval policy to an existing group. 2 out 3 users for approval (Note the user ID of the 3 users) For more information on setting the quorum approval policy at Fortanix DSM ...
  • Updated on Dec 10, 2024
  • Published on Jun 20, 2024
The getSecurityObject API fetches security object details by the Object UUID (Key Id). C# Go Java Python REST API using curl C# SecurityObjectsApi sObjectApi = new SecurityObjectsApi(); KeyObject key = sObjectApi.Ge...
  • Updated on Dec 11, 2024
  • Published on Jun 3, 2024
C# Go Java Python PHP Javascript REST API using curl Configuration.Default.BasePath = "
  • Updated on Mar 23, 2026
  • Published on Jun 3, 2024
C++ C# Go Java Python PHP Javascript REST API using curl C++ string decrypt(CK_FUNCTION_LIST_PTR p11, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey, string iv_cipher) { CK_RV rv; CK_BYTE *plain; CK_U...
  • Updated on Aug 29, 2026
  • Published on Jun 20, 2024
1.0 Overview To update an existing quorum approval policy, you need to request that the changes in the policy be approved. For more information on setting the quorum approval policy at Fortanix DSM group-level, refer to Group Quorum Policy ....
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
Supported by RSA and EC type of keys. For signature, one can pass one of the following inputs: Data and Hash Alg : Pass in the entire data to be signed with the Hash Algorithm to be used for hashing (SHA1, SHA256, SHA512, etc) Hash : Only pa...
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
The getSecurityObjects API can also be used to lookup keys by name. The first parameter of this method restricts the returned value to only the Security-object with the requested name. C# Go Java Python REST API using cu...
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
To authenticate an application (app) using a certificate, you must first generate the client key and certificate files using RSA 2048, RSA 4096, or EC keys. The following examples uses RSA 2048 and EC key: Using RSA key: openssl req -newkey r...
  • Updated on Jul 22, 2025
  • Published on Jun 20, 2024
1.0 Overview For more information on the cryptographic policy, refer to the User's Guide: Group Cryptographic Policy . Following is an example of Cryptographic policy which: Allows only AES 256 keys. Allows only RSA 2048 and above key...
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
NOTE Data and Hash should be base64 encoded. Go Java Python REST API using curl Go data := byte[]("Hello World!") keyId :=
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
Fortanix DSM can generate new security objects (Cryptographic and MAC keys) with random bytes. Creating keys is performed with a generateSecurityObject API. The API input body, SobjectRequest object defines the properties of the key that will...
  • Updated on Sep 11, 2025
  • Published on Jun 3, 2024
Fortanix-Data-Security-Manager ( DSM ) can import keys, certificates, and secrets that were created outside of Fortanix DSM. Note that except for public keys and certificates, it is generally more secure to create keys inside of Fortanix DSM as de...
  • Updated on Aug 26, 2026
  • Published on Jun 3, 2024
This operation allows a Security-object to be encrypted by another key for export and transfer out of Fortanix-Data-Security-Manager ( DSM ) to other systems. Requirements: The target key to be wrapped, need to be marked Exportable . T...
  • Updated on Jun 9, 2026
  • Published on Jun 3, 2024
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 wi...
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
Security Objects need to be marked as exportable for this operation, which means that EXPORT operation needs to be enabled in Key Operations of the Security-object . C# Go Java Python PHP Javascript REST API u...
  • Updated on Apr 9, 2025
  • Published on Apr 9, 2025
1.0 Overview The following example uses Generic Batch API to perform encryption, decryption, and signing operations. For more information on how to use Generic Batch API, refer to Create a new batch request . 2.0 REST API Using the curl...
  • Updated on Aug 26, 2025
  • Published on Apr 9, 2025
1.0 Overview This article illustrates example use cases of Batch APIs to perform encryption, decryption, signing, and verifying operations. For more information on how to use the specific Batch APIs for encryption, decryption, signing, and verify...
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
C++ C# Go Java Python Javascript REST API using curl C++ CK_RV delete_key(CK_FUNCTION_LIST_PTR p11, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey) { return p11->C_DestroyObject(hSession, hKey); } C...
  • Updated on Dec 10, 2024
  • Published on Jun 3, 2024
Bearer tokens are valid for a limited period of time. User bearer tokens will expire after 24 hours of inactivity, and application bearer tokens will expire after 10 minutes of inactivity. An application may terminate its session to immediately inva...
Fortanix-logo

4.6

star-ratings

As of August 2025