SmartCardSession::requestCodeVerification()

Request a chip holder verification (CHV) code and verify the code.

Synopsis:

#include <smartcard_spi/SmartCardSession.hpp>
virtual sc_response_code_t smartcard_spi::SmartCardSession::requestCodeVerification(sc_code_type_t codeType, int minCodeLength, int maxCodeLength, bool allowCodeCaching, unsigned int flags, unsigned int ref, SmartCardHolderVerifier &smartCardHolderVerifier)=0

Since:

BlackBerry 10.3.0

Arguments:

codeType

The code type.

minCodeLength

The minimum code length; provide a negative value if the minimum code length is unknown.

maxCodeLength

The maximum code length; provide a negative value if the maximum code length is unknown.

allowCodeCaching

If true code caching is allowed by the driver, if false code caching is not allowed by the driver. Code caching is subject to settings and IT policy restrictions.

flags

Indicates whether the CHV is to be made against a local (SC_FL_IHV_LOCAL) or global (SC_FL_IHV_GLOBAL) code.

ref

A vendor-specific reference value.

smartCardHolderVerifier

An instance that can provide SmartCardHolderVerifier functionality. The provided instance should be prepared to handle callbacks from the smart card service. Attach/detach operations will not be called on this instance. The instance should be created and destroyed by the caller (that is, the provided instance is not a managed smart card resource).

Library:

libscs (For the qcc command, use the -l scs option to link against this library)

Description:

This function requests that the smart card service obtain a CHV code and call back to the verify() function in the interface to verify the code.

If the code is not cached or code caching is not allowed, the smart card service will display a dialog box to obtain the code from the user. The dialog box will comply with acceptable user experience (UX) flow for general code request dialog boxes.

The smart card service may invoke the following operations on the SmartCardHolderVerifier interface:
  • getSmartCardId()
  • getMaximumNumberOfPinAttempts()
  • getNumberOfPinAttemptsRemaining()
  • verify()

If the driver associated with this session does not support the SmartCardHolderVerifier interface, an error will be returned.

Returns:

If successful, SCARD_S_SUCCESS is returned. Otherwise, an error code is returned.