![]() | Cryptographic Token Interface Standard |
PKCS#11 |
OTP key objects (object class CKO_OTP_KEY) hold secret keys used by OTP tokens. The following table defines the attributes common to all OTP keys, in addition to the attributes defined for secret keys, all of which are inherited by this class:
Table 86: Common OTP key attributes
Attribute | Data type | Meaning |
CKA_OTP_FORMAT | CK_ULONG | Format of OTP values produced with this key: CK_OTP_FORMAT_DECIMAL = Decimal (default) (UTF8-encoded) CK_OTP_FORMAT_HEXADECIMAL = Hexadecimal (UTF8-encoded) CK_OTP_FORMAT_ALPHANUMERIC = Alphanumeric (UTF8-encoded) CK_OTP_FORMAT_BINARY = Only binary values. |
CKA_OTP_LENGTH9 | CK_ULONG | Default length of OTP values (in the CKA_OTP_FORMAT) produced with this key. |
CKA_OTP_USER_FRIENDLY_MODE9 | CK_BBOOL | Set to CK_TRUE when the token is capable of returning OTPs suitable for human consumption. See the description of CKF_USER_FRIENDLY_OTP below. |
CKA_OTP_CHALLENGE_REQUIREMENT9 | CK_ULONG | Parameter requirements when generating or verifying OTP values with this key: CK_OTP_PARAM_MANDATORY = A challenge must be supplied. CK_OTP_PARAM_OPTIONAL = A challenge may be supplied but need not be. CK_OTP_PARAM_IGNORED = A challenge, if supplied, will be ignored. |
CKA_OTP_TIME_REQUIREMENT9 | CK_ULONG | Parameter requirements when generating or verifying OTP values with this key: CK_OTP_PARAM_MANDATORY = A time value must be supplied. CK_OTP_PARAM_OPTIONAL = A time value may be supplied but need not be. CK_OTP_PARAM_IGNORED = A time value, if supplied, will be ignored. |
CKA_OTP_COUNTER_REQUIREMENT9 | CK_ULONG | Parameter requirements when generating or verifying OTP values with this key: CK_OTP_PARAM_MANDATORY = A counter value must be supplied. CK_OTP_PARAM_OPTIONAL = A counter value may be supplied but need not be. CK_OTP_PARAM_IGNORED = A counter value, if supplied, will be ignored. |
CKA_OTP_PIN_REQUIREMENT9 | CK_ULONG | Parameter requirements when generating or verifying OTP values with this key: CK_OTP_PARAM_MANDATORY = A PIN value must be supplied. CK_OTP_PARAM_OPTIONAL = A PIN value may be supplied but need not be (if not supplied, then library will be responsible for collecting it) CK_OTP_PARAM_IGNORED = A PIN value, if supplied, will be ignored. |
CKA_OTP_COUNTER | Byte array | Value of the associated internal counter. Default value is empty (i.e. ulValueLen = 0). |
CKA_OTP_TIME | RFC 2279 string | Value of the associated internal UTC time in the form YYYYMMDDhhmmss. Default value is empty (i.e. ulValueLen = 0). |
CKA_OTP_USER_IDENTIFIER | RFC 2279 string | Text string that identifies a user associated with the OTP key (may be used to enhance the user experience). Default value is empty (i.e. ulValueLen = 0). |
CKA_OTP_SERVICE_IDENTIFIER | RFC 2279 string | Text string that identifies a service that may validate OTPs generated by this key. Default value is empty (i.e. ulValueLen = 0). |
CKA_OTP_SERVICE_LOGO | Byte array | Logotype image that identifies a service that may validate OTPs generated by this key. Default value is empty (i.e. ulValueLen = 0). |
CKA_OTP_SERVICE_LOGO_TYPE | RFC 2279 string | MIME type of the CKA_OTP_SERVICE_LOGO attribute value. Default value is empty (i.e. ulValueLen = 0). |
CKA_VALUE1, 4, 6, 7 | Byte array | Value of the key. |
CKA_VALUE_LEN2, 3 | CK_ULONG | Length in bytes of key value. |
Refer to Table 15 for table footnotes..
Note: A Cryptoki library may support PIN-code caching in order to reduce user interactions. An OTP-PKCS #11 application should therefore always consult the state of the CKA_OTP_PIN_REQUIREMENT attribute before each call to C_SignInit, as the value of this attribute may change dynamically.
For OTP tokens with multiple keys, the keys may be enumerated using C_FindObjects. The CKA_OTP_SERVICE_IDENTIFIER and/or the CKA_OTP_SERVICE_LOGO attribute may be used to distinguish between keys. The actual choice of key for a particular operation is however application-specific and beyond the scope of this document.
For all OTP keys, the CKA_ALLOWED_MECHANISMS attribute should be set as required.