Name

FC_GetInfo - return general information about the PKCS #11 library.

Syntax

CK_RV  FC_GetInfo(CK_INFO_PTR pInfo);

Parameters

FC_GetInfo has one parameter:

pInfo
points to a CK_INFO structure

Description

FC_GetInfo returns general information about the PKCS #11 library. On return, the CK_INFO structure that pInfo points to has the following information:

A user may call FC_GetInfo without logging into the token (to assume the NSS User role).

Return value

FC_GetInfo always returns CKR_OK.

FC_GetInfo should return CKR_ARGUMENTS_BAD if pInfo is NULL.

FC_GetInfo should return CKR_CRYPTOKI_NOT_INITIALIZED if the library is not initialized.

Examples

Note the use of the %.32s format string to print the manufacturerID and libraryDescription members of the CK_INFO structure.

#include <assert.h>
#include <stdio.h>

CK_FUNCTION_LIST_PTR pFunctionList;
CK_RV crv;
CK_INFO info;

crv = FC_GetFunctionList(&pFunctionList);
assert(crv == CKR_OK);

...

/* invoke FC_GetInfo as pFunctionList->C_GetInfo */
crv = pFunctionList->C_GetInfo(&info);
assert(crv == CKR_OK);
printf("General information about the PKCS #11 library:\n");
printf("    PKCS #11 version: %d.%d\n",
    (int)info.cryptokiVersion.major, (int)info.cryptokiVersion.minor);
printf("    manufacturer ID: %.32s\n", info.manufacturerID);
printf("    flags: 0x%08lx\n", info.flags);
printf("    library description: %.32s\n", info.libraryDescription);
printf("    library version: %d.%d\n",
    (int)info.libraryVersion.major, (int)info.libraryVersion.minor);
printf("\n");

See also