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