Obtains a list of slots in the system.
CK_SLOT_ID_PTR pSlotList,
CK_ULONG_PTR pulCount )
{
CK_RV xResult = CKR_OK;
( void ) ( tokenPresent );
{
xResult = CKR_CRYPTOKI_NOT_INITIALIZED;
LogError( (
"Failed to get slot list. PKCS #11 must be initialized "
"before any operations." ) );
}
if( NULL == pulCount )
{
xResult = CKR_ARGUMENTS_BAD;
LogError( (
"Failed to get slot list. Count pointer was NULL." ) );
}
if( xResult == CKR_OK )
{
if( NULL == pSlotList )
{
*pulCount = 1;
}
else
{
if( 0u == *pulCount )
{
xResult = CKR_BUFFER_TOO_SMALL;
LogWarn( (
"The buffer is too small to contain the slot list." ) );
}
else
{
*pulCount = 1;
LogDebug( (
"Successfully Returned a PKCS #11 slot with ID "
"%lu with a count of %lu.", (
unsigned long int )
pkcs11SLOT_ID, (
unsigned long int ) *pulCount ) );
}
}
}
return xResult;
}
This port does not implement the concept of separate slots/tokens.
- Parameters
-
[in] | tokenPresent | This parameter is unused by this port. |
[in] | pSlotList | Pointer to an array of slot IDs. At this time, only 1 slot is implemented. |
[in,out] | pulCount | Length of the slot list pxSlotList. Updated to contain the actual number of slots written to the list. |
- Returns
- CKR_OK if successful.