BuildIn Host Commands

Nov 28, 2011 at 11:29 AM

Thank you for the work on this project, this is a great piece of software. I have the simulator and PVVClashing demo running in Visual Basic Express 2010. I now want to write my own code to generate Visa CVV & PVV's. However, I get an exception error when I try and instantiate a new object from the BuildIn Host Command Class. Maybe I don't inderstand exactly what to do as I am not a great programmer and there is no example of using the buildin commands (expect in the core tests which I can not run because it needs Visual Studio). Help will be appreciated. If I insert this line into the PPVClashing demo I get the same error:

 Private Sub cmdFindAllPINs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFindAllPINs.Click

        Me.Enabled = False

        Try
            thales = New TCP.WorkerClient(New Net.Sockets.TcpClient(txtIPAddress.Text, Convert.ToInt32(txtPort.Text)))
            thales.InitOps()
            Dim HC As New HostCommands.BuildIn.HSMStatus_NO
        Catch ex As Exception
            doLog("Connection error (" + ex.Message + ")")
            Me.Enabled = True
            Exit Sub
        End Try

        txtLog.Text = ""

The Exception Error:

{"The given key was not present in the dictionary."}

 

 

Coordinator
Nov 28, 2011 at 11:58 AM

Don't sweat it, the code is pretty straight-forward but it's normal to struggle with it when using it for the first time.

The most probable cause of this would be that you haven't called the StartUp() method of ThalesMain. This sets up some stuff, amongst which is a resources store used to keep parameters. All commands use the resources store so the problem is most likely a command going there for some parameter and the store doesn't have it.

Nov 28, 2011 at 1:41 PM

Thank you. I have been tracing the code and could see that there are some values in "resources", but hey, I am new to .NET as well. I should be OK again. Can't wait to test against Hardware HSM as well, I have RG7000 & HSM8000's to play with!

Coordinator
Nov 28, 2011 at 2:14 PM

Out of curiosity, why do you need the simulator if you have access to physical HSMs?

Nov 28, 2011 at 2:54 PM

It is working!!!!

-> Out of curiosity, why do you need the simulator if you have access to physical HSMs?

I can carry my Laptop home but, security staff at financial institutions don't like it when you try and walk out with one of those devices... :>)

Coordinator
Nov 28, 2011 at 4:23 PM

:-) lol rsabear.