Example of signature generation.
using System;
using System.Text;
namespace SignHashSample
{
class Program
{
static void Main(string[] args)
{
string address = "10.10.10.10";
string user = "user"; user
string pass = "pwd";
string keyId = "key_id";
string message = "Test message ";
client.
Connect(address, user, pass);
Console.Out.WriteLine("Connected");
var bMessage = Encoding.ASCII.GetBytes(message);
var hash = client.
Hash(alg, bMessage);
Console.Out.WriteLine("Hash generated");
byte[] signature = client.
SignHash(keyId, hash, alg);
Console.Out.WriteLine("Signature generated");
Console.Out.WriteLine("Assinatura:\n {0}", BitConverter.ToString(signature).Replace("-", string.Empty));
Console.Out.WriteLine("Disconnected");
}
}
}
API class for accessing HSM functionalities Dinamo. In this class you can program using...
Definition DinamoClient.cs:93
HASH_ALG
Hash algorithm for signatures.
Definition DinamoClient.cs:137
byte[] SignHash(String keyId, byte[] bHash, DinamoClient.HASH_ALG algHash)
Sign a hash.
Definition DinamoClient.cs:4035
byte[] Hash(HASH_ALG alg, byte[] data)
Returns the hash of a piece of data.
Definition DinamoClient.cs:3964
void Connect(string User, string Password)
Establishes an encrypted connection to the HSM using the load balance settings.
Definition DinamoClient.cs:562
void Disconnect(bool flagClose)
Terminates the connection to the HSM.
Definition DinamoClient.cs:814
Namespace denoting a set of functions for accessing the HSM Dinamo and their respective exceptions.
Definition DinamoClient.cs:12