Dinamo.Hsm 4.12.0

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.12.0                
NuGet\Install-Package Dinamo.Hsm -Version 4.12.0                
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.12.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dinamo.Hsm --version 4.12.0                
#r "nuget: Dinamo.Hsm, 4.12.0"                
#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.12.0

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

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.13.0 187 9/24/2024
4.12.0 596 8/24/2024
4.11.0 211 7/18/2024
4.10.2 201 6/11/2024
4.10.1 165 4/29/2024
4.10.0 150 4/27/2024
4.9.2 1,337 2/16/2024
4.9.1 146 1/19/2024
4.9.0 141 1/12/2024
4.8.1 312 10/28/2023
4.8.0 145 10/23/2023
4.7.48 523 10/4/2023
4.7.47 367 9/12/2023
4.7.46 175 9/4/2023
4.7.45 204 8/16/2023
4.7.44 197 8/8/2023
4.7.43 183 7/28/2023
4.7.42 219 7/14/2023
4.7.41 166 6/20/2023
4.7.40 173 6/14/2023
4.7.39 184 5/17/2023
4.7.38 728 4/19/2023
4.7.37 812 3/18/2023
4.7.36 381 2/16/2023
4.7.35 4,656 12/2/2022
4.7.34 611 10/18/2022
4.7.33 769 9/19/2022
4.7.32 399 9/9/2022
4.7.31 389 8/31/2022
4.7.30 1,435 8/28/2022
4.7.29 402 8/19/2022
4.7.28 421 8/15/2022
4.7.27 448 7/15/2022
4.7.26 442 6/23/2022
4.7.25 414 6/7/2022
4.7.24 422 6/2/2022
4.7.23 476 5/25/2022
4.7.22 654 5/18/2022
4.7.21 614 5/10/2022
4.7.20 440 5/6/2022
4.7.19 466 4/13/2022
4.7.18 591 3/28/2022
4.7.17 463 3/24/2022
4.7.15 496 3/2/2022
4.7.14 444 2/24/2022
4.7.13 1,602 2/11/2022
4.7.12 739 12/3/2021
4.7.11 340 11/10/2021
4.7.10 305 11/9/2021
4.7.9 457 10/8/2021
4.7.8 365 9/28/2021
4.7.7 330 9/23/2021
4.7.6 324 9/14/2021
4.7.5 341 8/26/2021
4.7.4 319 8/24/2021
4.7.3 371 8/5/2021
4.7.2 403 7/29/2021
4.7.1 343 7/21/2021
4.7.0 358 7/6/2021
4.6.13 421 5/31/2021
4.6.12 440 5/29/2021
4.6.11 353 5/24/2021
4.6.10 623 5/14/2021
4.6.9 387 4/28/2021
4.6.8 357 4/24/2021
4.6.7 355 4/17/2021
4.6.6 414 4/1/2021
4.6.5 471 1/15/2021
4.6.4 537 12/18/2020
4.6.3 459 12/18/2020
4.6.2 965 12/10/2020
4.6.1 404 12/7/2020
4.6.0 458 11/26/2020
4.5.2 445 11/7/2020
4.5.1 491 10/29/2020
4.5.0 722 10/2/2020
4.2.7 522 9/17/2020
4.2.6 547 8/22/2020
4.1.6 526 4/30/2020
4.1.5 798 4/29/2020