Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

VB.NET UWP/WinRT Examples

Web API Categories

ASN.1
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(VB.NET UWP/WinRT) ScMinidriver - Get Smartcard Properties

See more ScMinidriver Examples

Gets information about the smart card currently inserted in the reader (or USB token).

Note: This functionality was introduced in Chilkat v9.5.0.87.

Note: The ScMinidriver functionality is for Windows-only because ScMinidriver DLLs only exist on Windows. In the next version, Chilkat will be releasing a Pkcs11 class to support Linux, MacOSX, and possibly other operating systems.

Chilkat Universal Windows Platform (UWP) / WinRT Downloads

Chilkat for the Universal Windows Platform (UWP)

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim scmd As New Chilkat.ScMinidriver

' Reader names (smart card readers or USB tokens) can be discovered
' via PCSC List Readers or PCSC Find Smart Cards
Dim readerName As String = "Alcor Micro USB Smart Card Reader 0"
Dim success As Boolean = scmd.AcquireContext(readerName)
If (success = False) Then
    Debug.WriteLine(scmd.LastErrorText)
    Exit Sub
End If


Dim json As New Chilkat.JsonObject
json.EmitCompact = False

success = scmd.GetCardProperties(json)
If (success = False) Then
    Debug.WriteLine(scmd.LastErrorText)
    Exit Sub
End If


Debug.WriteLine(json.Emit())

' Here is sample output:
' See below for sample code to parse the JSON.
' 
' NOTE: Not all smart cards support all properties.
' The GetCardProperties method will return information for all properties supported by the card.

' {
'   "bytesAvailable": 74752,
'   "containersAvailable": 18,
'   "maxKeyContainers": 20,
'   "capabilities": {
'     "fCertificateCompression": false,
'     "fKeyGen": true
'   },
'   "keySizes": {
'     "minimumBitlen": 2048,
'     "defaultBitlen": 2048,
'     "maximumBitlen": 4096,
'     "incrementalBitlen": 1024
'   },
'   "readOnly": false,
'   "cacheMode": "global",
'   "supportsWinX509Enrollment": true,
'   "guid": "1201803d-03e6-772a-3d80-0112e6032a77",
'   "serial": "e6032a773d800112e6032a77",
'   "pins": [
'     "user",
'     "admin",
'     "role3",
'     "role4"
'   ],
'   "pin": {
'     "user": {
'       "type": "regular",
'       "purpose": "primaryCard",
'       "changePermission": [
'         "user"
'       ],
'       "unblockPermission": [
'         "admin"
'       ],
'       "cachePolicy": "normal",
'       "policyInfo": "00000000",
'       "flags": "00000000",
'       "acceptPlainTextPin": true,
'       "generateSessionPin": false
'     },
'     "admin": {
'       "type": "challenge/response",
'       "purpose": "administrator",
'       "changePermission": [
'         "admin"
'       ],
'       "cachePolicy": "normal",
'       "policyInfo": "00000000",
'       "flags": "00000000"
'     },
'     "role3": {
'       "type": "regular",
'       "purpose": "digitalSignature",
'       "changePermission": [
'         "role3"
'       ],
'       "unblockPermission": [
'         "role4"
'       ],
'       "cachePolicy": "alwaysPrompt",
'       "policyInfo": "00000000",
'       "flags": "00000000",
'       "acceptPlainTextPin": true,
'       "generateSessionPin": false
'     },
'     "role4": {
'       "type": "regular",
'       "purpose": "unblockOnly",
'       "changePermission": [
'         "role4"
'       ],
'       "cachePolicy": "normal",
'       "policyInfo": "00000000",
'       "flags": "00000000",
'       "acceptPlainTextPin": true,
'       "generateSessionPin": false
'     }
'   },
'   "importSupport": [
'     "plainText",
'     "rsaKeyest",
'     "eccKeyest",
'     "symmetric"
'   ],
'   "algorithms": [
'     "AES"
'   ],
'   "paddingSchemes": [
'     "block",
'     "pkcs1",
'     "pss",
'     "oaep"
'   ],
'   "chainingModes": [
'     "ChainingModeCBC"
'   ]
' }


' Use this online tool to generate parsing code from sample JSON: 
' Generate Parsing Code from JSON



Dim strVal As String

Dim bytesAvailable As Integer = json.IntOf("bytesAvailable")
Dim containersAvailable As Integer = json.IntOf("containersAvailable")
Dim maxKeyContainers As Integer = json.IntOf("maxKeyContainers")
Dim capabilitiesFCertificateCompression As Boolean = json.BoolOf("capabilities.fCertificateCompression")
Dim capabilitiesFKeyGen As Boolean = json.BoolOf("capabilities.fKeyGen")
Dim keySizesMinimumBitlen As Integer = json.IntOf("keySizes.minimumBitlen")
Dim keySizesDefaultBitlen As Integer = json.IntOf("keySizes.defaultBitlen")
Dim keySizesMaximumBitlen As Integer = json.IntOf("keySizes.maximumBitlen")
Dim keySizesIncrementalBitlen As Integer = json.IntOf("keySizes.incrementalBitlen")
Dim readOnly As Boolean = json.BoolOf("readOnly")
Dim cacheMode As String = json.StringOf("cacheMode")
Dim supportsWinX509Enrollment As Boolean = json.BoolOf("supportsWinX509Enrollment")
Dim guid As String = json.StringOf("guid")
Dim serial As String = json.StringOf("serial")
Dim pinUserType As String = json.StringOf("pin.user.type")
Dim pinUserPurpose As String = json.StringOf("pin.user.purpose")
Dim pinUserCachePolicy As String = json.StringOf("pin.user.cachePolicy")
Dim pinUserPolicyInfo As String = json.StringOf("pin.user.policyInfo")
Dim pinUserFlags As String = json.StringOf("pin.user.flags")
Dim pinUserAcceptPlainTextPin As Boolean = json.BoolOf("pin.user.acceptPlainTextPin")
Dim pinUserGenerateSessionPin As Boolean = json.BoolOf("pin.user.generateSessionPin")
Dim pinAdminType As String = json.StringOf("pin.admin.type")
Dim pinAdminPurpose As String = json.StringOf("pin.admin.purpose")
Dim pinAdminCachePolicy As String = json.StringOf("pin.admin.cachePolicy")
Dim pinAdminPolicyInfo As String = json.StringOf("pin.admin.policyInfo")
Dim pinAdminFlags As String = json.StringOf("pin.admin.flags")
Dim pinRole3Type As String = json.StringOf("pin.role3.type")
Dim pinRole3Purpose As String = json.StringOf("pin.role3.purpose")
Dim pinRole3CachePolicy As String = json.StringOf("pin.role3.cachePolicy")
Dim pinRole3PolicyInfo As String = json.StringOf("pin.role3.policyInfo")
Dim pinRole3Flags As String = json.StringOf("pin.role3.flags")
Dim pinRole3AcceptPlainTextPin As Boolean = json.BoolOf("pin.role3.acceptPlainTextPin")
Dim pinRole3GenerateSessionPin As Boolean = json.BoolOf("pin.role3.generateSessionPin")
Dim pinRole4Type As String = json.StringOf("pin.role4.type")
Dim pinRole4Purpose As String = json.StringOf("pin.role4.purpose")
Dim pinRole4CachePolicy As String = json.StringOf("pin.role4.cachePolicy")
Dim pinRole4PolicyInfo As String = json.StringOf("pin.role4.policyInfo")
Dim pinRole4Flags As String = json.StringOf("pin.role4.flags")
Dim pinRole4AcceptPlainTextPin As Boolean = json.BoolOf("pin.role4.acceptPlainTextPin")
Dim pinRole4GenerateSessionPin As Boolean = json.BoolOf("pin.role4.generateSessionPin")
Dim i As Integer = 0
Dim count_i As Integer = json.SizeOfArray("pins")
While i < count_i
    json.I = i
    strVal = json.StringOf("pins[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("pin.user.changePermission")
While i < count_i
    json.I = i
    strVal = json.StringOf("pin.user.changePermission[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("pin.user.unblockPermission")
While i < count_i
    json.I = i
    strVal = json.StringOf("pin.user.unblockPermission[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("pin.admin.changePermission")
While i < count_i
    json.I = i
    strVal = json.StringOf("pin.admin.changePermission[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("pin.role3.changePermission")
While i < count_i
    json.I = i
    strVal = json.StringOf("pin.role3.changePermission[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("pin.role3.unblockPermission")
While i < count_i
    json.I = i
    strVal = json.StringOf("pin.role3.unblockPermission[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("pin.role4.changePermission")
While i < count_i
    json.I = i
    strVal = json.StringOf("pin.role4.changePermission[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("importSupport")
While i < count_i
    json.I = i
    strVal = json.StringOf("importSupport[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("algorithms")
While i < count_i
    json.I = i
    strVal = json.StringOf("algorithms[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("paddingSchemes")
While i < count_i
    json.I = i
    strVal = json.StringOf("paddingSchemes[i]")
    i = i + 1
End While
i = 0
count_i = json.SizeOfArray("chainingModes")
While i < count_i
    json.I = i
    strVal = json.StringOf("chainingModes[i]")
    i = i + 1
End While




' Delete the context when finished with the card.
success = scmd.DeleteContext()
If (success = False) Then
    Debug.WriteLine(scmd.LastErrorText)
End If


 

© 2000-2022 Chilkat Software, Inc. All Rights Reserved.