Dinamo.Hsm 4.10.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Dinamo.Hsm --version 4.10.2                
NuGet\Install-Package Dinamo.Hsm -Version 4.10.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dinamo.Hsm" Version="4.10.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dinamo.Hsm --version 4.10.2                
#r "nuget: Dinamo.Hsm, 4.10.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Dinamo.Hsm as a Cake Addin
#addin nuget:?package=Dinamo.Hsm&version=4.10.2

// Install Dinamo.Hsm as a Cake Tool
#tool nuget:?package=Dinamo.Hsm&version=4.10.2                

About

Supports the operation with Dinamo Networks HSMs (Hardware Security Module) for cryptographic functions.

Key Features

Provides an integration API for general functions such as key generation, encryption, digital signatures and specialized functions such as Blockchain, XML signature, Pix, SPB and OATH.

How to use

using System;
using System.Collections.Generic;
using System.Text;
using Dinamo.Hsm;

namespace TesteNF
{
    class Program
    {
        static void Main(string[] args)
        {


            DinamoClient dinamo = new DinamoClient();

            dinamo.Connect( "127.0.0.1",
                            "master",
                            "12345678" );

            //Nome da chave AES 256 dentro do HSM
            string keyId    = "aes256";

            byte[] iv   = new byte[DinamoApi.AES_IV_LEN]{   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

            //Dado original
            byte[] originalData     = Encoding.ASCII.GetBytes("asdfasdfasdfasdfasdfas");

            //Adiciona o tamanho do bloco para caber um possivel padding.
            //O tamanho do IV eh igual ao tamanho do bloco.
            byte[] dataToEncrypt    = new byte[originalData.Length + DinamoApi.AES_IV_LEN];
            //Bloco que sera encriptado. Estes dados serao sobrescritos.
            Array.Copy(originalData, dataToEncrypt, originalData.Length);

            int dataToEncryptLen    = originalData.Length;

            dinamo.Encrypt( keyId,
                            IntPtr.Zero,
                            true,
                            iv,
                            DinamoClient.MODE_TYPE.MODE_CBC,
                            DinamoClient.PADDING_TYPE.PKCS5_PADDING,
                            dataToEncrypt,
                            ref dataToEncryptLen,
                            dataToEncrypt.Length);


            dinamo.Decrypt( keyId,
                            IntPtr.Zero,
                            true,
                            iv,
                            DinamoClient.MODE_TYPE.MODE_CBC,
                            DinamoClient.PADDING_TYPE.PKCS5_PADDING,
                            dataToEncrypt,
                            ref dataToEncryptLen );



            Console.Out.WriteLine("Dado decriptado:\n {0}", System.Text.Encoding.Default.GetString(dataToEncrypt));

            Console.In.ReadLine();
        }
    }

}

Examples

Additional examples are available.

Additional Documentation

Dinamo HSM API .NET

Feedback & Support

Bug reports and suggestions are welcome. Please contact Dinamo Networks Support Services.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.0

    • No dependencies.
  • net5.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Dinamo.Hsm:

Package Downloads
Lacuna.Pki.Dinamo

Adds Dinamo HSM features to Lacuna Pki SDK

NovaSigner

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.15.0 85 12/17/2024
4.14.0 100 12/6/2024
4.13.0 210 9/24/2024
4.12.0 957 8/24/2024
4.11.0 223 7/18/2024
4.10.2 210 6/11/2024
4.10.1 170 4/29/2024
4.10.0 155 4/27/2024
4.9.2 1,474 2/16/2024
4.9.1 152 1/19/2024
4.9.0 146 1/12/2024
4.8.1 317 10/28/2023
4.8.0 150 10/23/2023
4.7.48 529 10/4/2023
4.7.47 380 9/12/2023
4.7.46 180 9/4/2023
4.7.45 211 8/16/2023
4.7.44 202 8/8/2023
4.7.43 188 7/28/2023
4.7.42 225 7/14/2023
4.7.41 171 6/20/2023
4.7.40 178 6/14/2023
4.7.39 189 5/17/2023
4.7.38 733 4/19/2023
4.7.37 865 3/18/2023
4.7.36 387 2/16/2023
4.7.35 5,247 12/2/2022
4.7.34 632 10/18/2022
4.7.33 779 9/19/2022
4.7.32 405 9/9/2022
4.7.31 395 8/31/2022
4.7.30 1,441 8/28/2022
4.7.29 408 8/19/2022
4.7.28 427 8/15/2022
4.7.27 456 7/15/2022
4.7.26 448 6/23/2022
4.7.25 420 6/7/2022
4.7.24 428 6/2/2022
4.7.23 482 5/25/2022
4.7.22 660 5/18/2022
4.7.21 620 5/10/2022
4.7.20 446 5/6/2022
4.7.19 472 4/13/2022
4.7.18 597 3/28/2022
4.7.17 469 3/24/2022
4.7.15 524 3/2/2022
4.7.14 450 2/24/2022
4.7.13 1,613 2/11/2022
4.7.12 746 12/3/2021
4.7.11 346 11/10/2021
4.7.10 311 11/9/2021
4.7.9 466 10/8/2021
4.7.8 371 9/28/2021
4.7.7 336 9/23/2021
4.7.6 330 9/14/2021
4.7.5 347 8/26/2021
4.7.4 326 8/24/2021
4.7.3 377 8/5/2021
4.7.2 409 7/29/2021
4.7.1 349 7/21/2021
4.7.0 364 7/6/2021
4.6.13 427 5/31/2021
4.6.12 446 5/29/2021
4.6.11 359 5/24/2021
4.6.10 629 5/14/2021
4.6.9 393 4/28/2021
4.6.8 363 4/24/2021
4.6.7 361 4/17/2021
4.6.6 420 4/1/2021
4.6.5 477 1/15/2021
4.6.4 543 12/18/2020
4.6.3 465 12/18/2020
4.6.2 971 12/10/2020
4.6.1 412 12/7/2020
4.6.0 464 11/26/2020
4.5.2 451 11/7/2020
4.5.1 499 10/29/2020
4.5.0 730 10/2/2020
4.2.7 528 9/17/2020
4.2.6 553 8/22/2020
4.1.6 534 4/30/2020
4.1.5 804 4/29/2020