Cryptoki: a cryptographic Token Interface



Download 360.55 Kb.
Page68/196
Date22.12.2023
Size360.55 Kb.
#63026
1   ...   64   65   66   67   68   69   70   71   ...   196
v201-95
pkcs11-base-v2.40-cos01
Attribute

Data type

Meaning

CKA_VALUE1,4,6,7

Byte array

Key value (always 16 bytes long)

The following is a sample template for creating an IDEA secret key object:


CK_OBJECT_CLASS class = CKO_SECRET_KEY;
CK_KEY_TYPE keyType = CKK_IDEA;
CK_CHAR label[] = “An IDEA secret key object”;
CK_BYTE value[16] = {...};
CK_BBOOL true = TRUE;
CK_ATTRIBUTE template[] = {
{CKA_CLASS, &class, sizeof(class)},
{CKA_KEY_TYPE, &keyType, sizeof(keyType)},
{CKA_TOKEN, &true, sizeof(true)},
{CKA_LABEL, label, sizeof(label)},
{CKA_ENCRYPT, &true, sizeof(true)},
{CKA_VALUE, value, sizeof(value)}
};

9.8.12. CDMF secret key objects


CDMF secret key objects (object class CKO_SECRET_KEY, key type CKK_CDMF) hold single-length CDMF keys. The following table defines the CDMF secret key object attributes, in addition to the common attributes listed in Table 14, Table 19, and Table 32:
Table 44, CDMF Secret Key Object

Attribute

Data type

Meaning

CKA_VALUE1,4,6,7

Byte array

Key value (always 8 bytes long)

CDMF keys must always have their parity bits properly set in exactly the same fashion described for DES keys in FIPS PUB 46-2. Attempting to create or unwrap a CDMF key with incorrect parity will return an error.


The following is a sample template for creating a CDMF secret key object:
CK_OBJECT_CLASS class = CKO_SECRET_KEY;
CK_KEY_TYPE keyType = CKK_CDMF;
CK_CHAR label[] = “A CDMF secret key object”;
CK_BYTE value[8] = {...};
CK_BBOOL true = TRUE;
CK_ATTRIBUTE template[] = {
{CKA_CLASS, &class, sizeof(class)},
{CKA_KEY_TYPE, &keyType, sizeof(keyType)},
{CKA_TOKEN, &true, sizeof(true)},
{CKA_LABEL, label, sizeof(label)},
{CKA_ENCRYPT, &true, sizeof(true)},
{CKA_VALUE, value, sizeof(value)}
};

Download 360.55 Kb.

Share with your friends:
1   ...   64   65   66   67   68   69   70   71   ...   196




The database is protected by copyright ©ininet.org 2024
send message

    Main page