PKCS#11 Automatic Test

This sample automatically invokes all the main functions of the PKCS#11 API.

The test will chain the following operations:

  • C_Initialize
  • Start the device events handler
  • C_GetInfo
  • C_GetSlotList
  • C_GetSlotInfo
  • C_GetTokenInfo
  • C_GetMechanismList
  • C_GetMechanismInfo
  • C_OpenSession
  • C_GetSessionInfo
  • C_FindObjects to get the PIN configuration object handle
  • C_GetAttributeValue to get the PIN configuration object value
  • C_Login as user (using the current user PIN as entered below or the PIN typed on the PIN pad)
  • ETC_DeviceIOCTL to get the SWYS features of the SWYS device
  • C_FindObjects to get the SWYS certificate handles present on the SWYS device
  • C_GenerateKeyPair to create a RSA key pair on the device
  • ETC_SignEx to perform a SWYS signature by the SWYS device (MUST be approved by pressing the 'OK' button on the reader)
  • C_Sign to create a RSA signature
  • C_Verify to verify a RSA signature
  • C_Encrypt to create a RSA encryption
  • C_Decrypt to decrypt the RSA encryption
  • C_CreateObject to create a data object
  • C_FindObjects to find the data object handle
  • C_SetAttributeValue to set the data object label
  • C_GetAttributeValue to get the data object label
  • C_DestroyObject to delete the data object
  • C_SetPIN to set a new user PIN (using the new user PIN as entered below or the PIN typed on the PIN pad)
  • C_Logout as user
  • C_Login as Security Officer (using the SO PIN as entered below)
  • C_InitToken (using the new PIN as entered below)
  • C_InitPIN (using the new user PIN as entered below or the PIN typed on the PIN pad)
  • C_CloseSession
  • C_CloseAllSessions
  • Stop the device events handler
  • C_Finalize

Supported hardware:

  • eToken / IDPrime card
  • CCID reader
  • SWAT reader

Prerequisites and general information:

  • The token/smartcard must be initialized without enabling the "password must be changed after first logon" setting
  • While using a device with a PIN pad, the user authentication will be managed directly on the device
  • While using a non PIN pad device, the PIN operations will be performed automaticaly using the values of the PIN fields below
  • The new PIN that is used must be compliant with the PIN policy applied to your device otherwise the operation will fail

PIN configuration:

Start the test !

Processing command...