Cryptographic Token Interface Standard |
PKCS#11 |
Diffie-Hellman domain parameter objects (object class CKO_DOMAIN_PARAMETERS, key type CKK_DH) hold Diffie-Hellman domain parameters. The following table defines the Diffie-Hellman domain parameter object attributes, in addition to the common attributes listed in Table 15 , Table 19 , and Table 60 :
Table 62, Diffie-Hellman Domain Parameter Object Attributes
Attribute | Data type | Meaning |
CKA_PRIME1,4 | Big integer | Prime p |
CKA_BASE1,4 | Big integer | Base g |
CKA_PRIME_BITS2,3 | CK_ULONG | Length of the prime value. |
The CKA_PRIME and CKA_BASE attribute values are collectively the "Diffie-Hellman domain parameters". Depending on the token, there may be limits on the length of the key components. See PKCS #3 for more information on Diffie-Hellman domain parameters.
The following is a sample template for creating a Diffie-Hellman domain parameter object:
CK_OBJECT_CLASS class = CKO_DOMAIN_PARAMETERS; CK_KEY_TYPE keyType = CKK_DH; CK_UTF8CHAR label[] = "A Diffie-Hellman domain parameters object"; CK_BYTE prime[] = {...}; CK_BYTE base[] = {...}; 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)-1}, {CKA_PRIME, prime, sizeof(prime)}, {CKA_BASE, base, sizeof(base)}, };