Dinamo.Hsm 4.10.2

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
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.10.2 76 6/11/2024
4.10.1 131 4/29/2024
4.10.0 124 4/27/2024
4.9.2 529 2/16/2024
4.9.1 129 1/19/2024
4.9.0 103 1/12/2024
4.8.1 282 10/28/2023
4.8.0 115 10/23/2023
4.7.48 486 10/4/2023
4.7.47 281 9/12/2023
4.7.46 151 9/4/2023
4.7.45 191 8/16/2023
4.7.44 172 8/8/2023
4.7.43 154 7/28/2023
4.7.42 181 7/14/2023
4.7.41 141 6/20/2023
4.7.40 143 6/14/2023
4.7.39 155 5/17/2023
4.7.38 655 4/19/2023
4.7.37 493 3/18/2023
4.7.36 340 2/16/2023
4.7.35 3,038 12/2/2022
4.7.34 536 10/18/2022
4.7.33 746 9/19/2022
4.7.32 375 9/9/2022
4.7.31 362 8/31/2022
4.7.30 1,332 8/28/2022
4.7.29 378 8/19/2022
4.7.28 386 8/15/2022
4.7.27 421 7/15/2022
4.7.26 418 6/23/2022
4.7.25 387 6/7/2022
4.7.24 396 6/2/2022
4.7.23 467 5/25/2022
4.7.22 627 5/18/2022
4.7.21 587 5/10/2022
4.7.20 417 5/6/2022
4.7.19 441 4/13/2022
4.7.18 563 3/28/2022
4.7.17 440 3/24/2022
4.7.15 470 3/2/2022
4.7.14 421 2/24/2022
4.7.13 1,508 2/11/2022
4.7.12 689 12/3/2021
4.7.11 318 11/10/2021
4.7.10 277 11/9/2021
4.7.9 433 10/8/2021
4.7.8 343 9/28/2021
4.7.7 309 9/23/2021
4.7.6 304 9/14/2021
4.7.5 320 8/26/2021
4.7.4 300 8/24/2021
4.7.3 348 8/5/2021
4.7.2 394 7/29/2021
4.7.1 316 7/21/2021
4.7.0 334 7/6/2021
4.6.13 395 5/31/2021
4.6.12 417 5/29/2021
4.6.11 343 5/24/2021
4.6.10 601 5/14/2021
4.6.9 360 4/28/2021
4.6.8 336 4/24/2021
4.6.7 333 4/17/2021
4.6.6 392 4/1/2021
4.6.5 447 1/15/2021
4.6.4 516 12/18/2020
4.6.3 433 12/18/2020
4.6.2 919 12/10/2020
4.6.1 380 12/7/2020
4.6.0 432 11/26/2020
4.5.2 417 11/7/2020
4.5.1 464 10/29/2020
4.5.0 693 10/2/2020
4.2.7 498 9/17/2020
4.2.6 523 8/22/2020
4.1.6 501 4/30/2020
4.1.5 760 4/29/2020