Question How to write/read from a smartcard

Sterlingard

Member
Joined
Mar 25, 2014
Messages
7
Programming Experience
Beginner
I am to develop an electronic health records management system which requires some patient information to be stored on a smart card. i have no idea of how to go about it. my problems are :

i. How do i write or save the information to the smart card?
ii. How do i read the information from the smart card?
 
I don't want to discourage people from using forums and this forum in particular but you really should only be posting questions here when you have tried and failed to find or use existing information. You should always be searching the web for existing information first and you would have found relevant information had you done so in this case.

https://www.google.com.au/search?q=...e_rd=ctrl&ei=IxcyU6qbAcGN8Qe2rYDoBg&gws_rd=cr

Look first, ask questions later. If you use that information and have issues along the way, that would be the time to post a question here, explaining exactly what you've done, what you expected to happen and what actually did happen.
 
I cannot begin to express how worried this thread makes me. You are NEVER to store any patient information on a smartcard, EVER, unless well encrypted and secured on a specialty smartcard, and even then a bar code ID pointing to a central (secured - think bank or defense secured) database is just much better. Just the thought of it is insane. It's very easy to steal a box of smartcards, and they are very easy to crack unless specifically designed to withstand it. And how did YOU end up getting the job if you can't even look up well known standards all by yourself? This is the kind of thing that needs to be designed professionally with security in mind, and audited often.
 
i have read so many discussions on smartcard programming yet i am not getting any help. I have gained some knowledge though but that is not enough to help me accomplish my task. I need to know how to make i application connect to the smartcard, read/write data to it. with the little meaning i managed to make from the various forums and articles i read i was able to add this code to my project:
Private Sub btnread_Click(sender As Object, e As EventArgs) Handles btnread.Click
        Try
            Dim ResMgr As New SCResMgr
            ResMgr.EstablishContext(SCardContextScope.System)


            Dim Reader As New SCReader(ResMgr)
            Dim strReadername As String


            strReadername = SCReader.SelectReader()
            If (strReadername = Nothing) Then
                MessageBox.Show("Reader not connected")
                Exit Sub
            End If
            LabelReaderName.Text = +strReadername + vbCrLf
            Reader.Connect(strReadername, SCardAccessMode.Exclusive, SCardProtocolIdentifiers.T0)
        Catch ex As Exception


        End Try
    End Sub

The code allows me to select my card reader. that is not what i need. Please help me with the connect, read, write, disconnect commands. thank you
 
Last edited by a moderator:
Back
Top