1b106467Jason King/* Copyright (c) OASIS Open 2016. All Rights Reserved./
2b106467Jason King * /Distributed under the terms of the OASIS IPR Policy,
3b106467Jason King * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
4b106467Jason King * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
5b106467Jason King * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others.
6b106467Jason King */
77c478bdstevel@tonic-gate
8b106467Jason King/* Latest version of the specification:
9b106467Jason King * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
107c478bdstevel@tonic-gate */
117c478bdstevel@tonic-gate
127c478bdstevel@tonic-gate/* See top of pkcs11.h for information about the macros that
137c478bdstevel@tonic-gate * must be defined and the structure-packing conventions that
14b106467Jason King * must be set before including this file.
15b106467Jason King */
167c478bdstevel@tonic-gate
177c478bdstevel@tonic-gate#ifndef _PKCS11T_H_
187c478bdstevel@tonic-gate#define _PKCS11T_H_ 1
197c478bdstevel@tonic-gate
20b106467Jason King#define CRYPTOKI_VERSION_MAJOR          2
21b106467Jason King#define CRYPTOKI_VERSION_MINOR          40
22b106467Jason King#define CRYPTOKI_VERSION_AMENDMENT      0
231e9884amcpowers
24b106467Jason King#define CK_TRUE         1
25b106467Jason King#define CK_FALSE        0
26f66d273izick
277c478bdstevel@tonic-gate#ifndef CK_DISABLE_TRUE_FALSE
287c478bdstevel@tonic-gate#ifndef FALSE
29f66d273izick#define FALSE CK_FALSE
307c478bdstevel@tonic-gate#endif
317c478bdstevel@tonic-gate#ifndef TRUE
32f66d273izick#define TRUE CK_TRUE
337c478bdstevel@tonic-gate#endif
347c478bdstevel@tonic-gate#endif
357c478bdstevel@tonic-gate
367c478bdstevel@tonic-gate/* an unsigned 8-bit value */
377c478bdstevel@tonic-gatetypedef unsigned char     CK_BYTE;
387c478bdstevel@tonic-gate
397c478bdstevel@tonic-gate/* an unsigned 8-bit character */
407c478bdstevel@tonic-gatetypedef CK_BYTE           CK_CHAR;
417c478bdstevel@tonic-gate
427c478bdstevel@tonic-gate/* an 8-bit UTF-8 character */
437c478bdstevel@tonic-gatetypedef CK_BYTE           CK_UTF8CHAR;
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gate/* a BYTE-sized Boolean flag */
467c478bdstevel@tonic-gatetypedef CK_BYTE           CK_BBOOL;
477c478bdstevel@tonic-gate
487c478bdstevel@tonic-gate/* an unsigned value, at least 32 bits long */
497c478bdstevel@tonic-gatetypedef unsigned long int CK_ULONG;
507c478bdstevel@tonic-gate
517c478bdstevel@tonic-gate/* a signed value, the same size as a CK_ULONG */
527c478bdstevel@tonic-gatetypedef long int          CK_LONG;
537c478bdstevel@tonic-gate
547c478bdstevel@tonic-gate/* at least 32 bits; each bit is a Boolean flag */
557c478bdstevel@tonic-gatetypedef CK_ULONG          CK_FLAGS;
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gate
587c478bdstevel@tonic-gate/* some special values for certain CK_ULONG variables */
59b106467Jason King#define CK_UNAVAILABLE_INFORMATION      (~0UL)
60b106467Jason King#define CK_EFFECTIVELY_INFINITE         0UL
617c478bdstevel@tonic-gate
627c478bdstevel@tonic-gate
637c478bdstevel@tonic-gatetypedef CK_BYTE     CK_PTR   CK_BYTE_PTR;
647c478bdstevel@tonic-gatetypedef CK_CHAR     CK_PTR   CK_CHAR_PTR;
657c478bdstevel@tonic-gatetypedef CK_UTF8CHAR CK_PTR   CK_UTF8CHAR_PTR;
667c478bdstevel@tonic-gatetypedef CK_ULONG    CK_PTR   CK_ULONG_PTR;
677c478bdstevel@tonic-gatetypedef void        CK_PTR   CK_VOID_PTR;
687c478bdstevel@tonic-gate
697c478bdstevel@tonic-gate/* Pointer to a CK_VOID_PTR-- i.e., pointer to pointer to void */
707c478bdstevel@tonic-gatetypedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR;
717c478bdstevel@tonic-gate
727c478bdstevel@tonic-gate
73b106467Jason King/* The following value is always invalid if used as a session
74b106467Jason King * handle or object handle
75b106467Jason King */
76b106467Jason King#define CK_INVALID_HANDLE       0UL
777c478bdstevel@tonic-gate
787c478bdstevel@tonic-gate
797c478bdstevel@tonic-gatetypedef struct CK_VERSION {
807c478bdstevel@tonic-gate  CK_BYTE       major;  /* integer portion of version number */
817c478bdstevel@tonic-gate  CK_BYTE       minor;  /* 1/100ths portion of version number */
827c478bdstevel@tonic-gate} CK_VERSION;
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gatetypedef CK_VERSION CK_PTR CK_VERSION_PTR;
857c478bdstevel@tonic-gate
867c478bdstevel@tonic-gate
877c478bdstevel@tonic-gatetypedef struct CK_INFO {
887c478bdstevel@tonic-gate  CK_VERSION    cryptokiVersion;     /* Cryptoki interface ver */
897c478bdstevel@tonic-gate  CK_UTF8CHAR   manufacturerID[32];  /* blank padded */
907c478bdstevel@tonic-gate  CK_FLAGS      flags;               /* must be zero */
917c478bdstevel@tonic-gate  CK_UTF8CHAR   libraryDescription[32];  /* blank padded */
927c478bdstevel@tonic-gate  CK_VERSION    libraryVersion;          /* version of library */
937c478bdstevel@tonic-gate} CK_INFO;
947c478bdstevel@tonic-gate
957c478bdstevel@tonic-gatetypedef CK_INFO CK_PTR    CK_INFO_PTR;
967c478bdstevel@tonic-gate
977c478bdstevel@tonic-gate
987c478bdstevel@tonic-gate/* CK_NOTIFICATION enumerates the types of notifications that
99b106467Jason King * Cryptoki provides to an application
100b106467Jason King */
1017c478bdstevel@tonic-gatetypedef CK_ULONG CK_NOTIFICATION;
102b106467Jason King#define CKN_SURRENDER           0UL
103b106467Jason King#define CKN_OTP_CHANGED         1UL
1047c478bdstevel@tonic-gate
1057c478bdstevel@tonic-gatetypedef CK_ULONG          CK_SLOT_ID;
1067c478bdstevel@tonic-gate
1077c478bdstevel@tonic-gatetypedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR;
1087c478bdstevel@tonic-gate
1097c478bdstevel@tonic-gate
1107c478bdstevel@tonic-gate/* CK_SLOT_INFO provides information about a slot */
1117c478bdstevel@tonic-gatetypedef struct CK_SLOT_INFO {
1127c478bdstevel@tonic-gate  CK_UTF8CHAR   slotDescription[64];  /* blank padded */
1137c478bdstevel@tonic-gate  CK_UTF8CHAR   manufacturerID[32];   /* blank padded */
1147c478bdstevel@tonic-gate  CK_FLAGS      flags;
1157c478bdstevel@tonic-gate
1167c478bdstevel@tonic-gate  CK_VERSION    hardwareVersion;  /* version of hardware */
1177c478bdstevel@tonic-gate  CK_VERSION    firmwareVersion;  /* version of firmware */
1187c478bdstevel@tonic-gate} CK_SLOT_INFO;
1197c478bdstevel@tonic-gate
1207c478bdstevel@tonic-gate/* flags: bit flags that provide capabilities of the slot
1217c478bdstevel@tonic-gate *      Bit Flag              Mask        Meaning
1227c478bdstevel@tonic-gate */
123b106467Jason King#define CKF_TOKEN_PRESENT     0x00000001UL  /* a token is there */
124b106467Jason King#define CKF_REMOVABLE_DEVICE  0x00000002UL  /* removable devices*/
125b106467Jason King#define CKF_HW_SLOT           0x00000004UL  /* hardware slot */
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gatetypedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR;
1287c478bdstevel@tonic-gate
1297c478bdstevel@tonic-gate
1307c478bdstevel@tonic-gate/* CK_TOKEN_INFO provides information about a token */
1317c478bdstevel@tonic-gatetypedef struct CK_TOKEN_INFO {
1327c478bdstevel@tonic-gate  CK_UTF8CHAR   label[32];           /* blank padded */
1337c478bdstevel@tonic-gate  CK_UTF8CHAR   manufacturerID[32];  /* blank padded */
1347c478bdstevel@tonic-gate  CK_UTF8CHAR   model[16];           /* blank padded */
1357c478bdstevel@tonic-gate  CK_CHAR       serialNumber[16];    /* blank padded */
1367c478bdstevel@tonic-gate  CK_FLAGS      flags;               /* see below */
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gate  CK_ULONG      ulMaxSessionCount;     /* max open sessions */
1397c478bdstevel@tonic-gate  CK_ULONG      ulSessionCount;        /* sess. now open */
1407c478bdstevel@tonic-gate  CK_ULONG      ulMaxRwSessionCount;   /* max R/W sessions */
1417c478bdstevel@tonic-gate  CK_ULONG      ulRwSessionCount;      /* R/W sess. now open */
1427c478bdstevel@tonic-gate  CK_ULONG      ulMaxPinLen;           /* in bytes */
1437c478bdstevel@tonic-gate  CK_ULONG      ulMinPinLen;           /* in bytes */
1447c478bdstevel@tonic-gate  CK_ULONG      ulTotalPublicMemory;   /* in bytes */
1457c478bdstevel@tonic-gate  CK_ULONG      ulFreePublicMemory;    /* in bytes */
1467c478bdstevel@tonic-gate  CK_ULONG      ulTotalPrivateMemory;  /* in bytes */
1477c478bdstevel@tonic-gate  CK_ULONG      ulFreePrivateMemory;   /* in bytes */
1487c478bdstevel@tonic-gate  CK_VERSION    hardwareVersion;       /* version of hardware */
1497c478bdstevel@tonic-gate  CK_VERSION    firmwareVersion;       /* version of firmware */
1507c478bdstevel@tonic-gate  CK_CHAR       utcTime[16];           /* time */
1517c478bdstevel@tonic-gate} CK_TOKEN_INFO;
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gate/* The flags parameter is defined as follows:
154f66d273izick *      Bit Flag                    Mask        Meaning
1557c478bdstevel@tonic-gate */
156b106467Jason King#define CKF_RNG                     0x00000001UL  /* has random # generator */
157b106467Jason King#define CKF_WRITE_PROTECTED         0x00000002UL  /* token is write-protected */
158b106467Jason King#define CKF_LOGIN_REQUIRED          0x00000004UL  /* user must login */
159b106467Jason King#define CKF_USER_PIN_INITIALIZED    0x00000008UL  /* normal user's PIN is set */
160b106467Jason King
161b106467Jason King/* CKF_RESTORE_KEY_NOT_NEEDED.  If it is set,
1627c478bdstevel@tonic-gate * that means that *every* time the state of cryptographic
1637c478bdstevel@tonic-gate * operations of a session is successfully saved, all keys
164b106467Jason King * needed to continue those operations are stored in the state
165b106467Jason King */
166b106467Jason King#define CKF_RESTORE_KEY_NOT_NEEDED  0x00000020UL
1677c478bdstevel@tonic-gate
168b106467Jason King/* CKF_CLOCK_ON_TOKEN.  If it is set, that means
1697c478bdstevel@tonic-gate * that the token has some sort of clock.  The time on that
170b106467Jason King * clock is returned in the token info structure
171b106467Jason King */
172b106467Jason King#define CKF_CLOCK_ON_TOKEN          0x00000040UL
1737c478bdstevel@tonic-gate
174b106467Jason King/* CKF_PROTECTED_AUTHENTICATION_PATH.  If it is
1757c478bdstevel@tonic-gate * set, that means that there is some way for the user to login
176b106467Jason King * without sending a PIN through the Cryptoki library itself
177b106467Jason King */
178b106467Jason King#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100UL
1797c478bdstevel@tonic-gate
180b106467Jason King/* CKF_DUAL_CRYPTO_OPERATIONS.  If it is true,
1817c478bdstevel@tonic-gate * that means that a single session with the token can perform
1827c478bdstevel@tonic-gate * dual simultaneous cryptographic operations (digest and
1837c478bdstevel@tonic-gate * encrypt; decrypt and digest; sign and encrypt; and decrypt
184b106467Jason King * and sign)
185b106467Jason King */
186b106467Jason King#define CKF_DUAL_CRYPTO_OPERATIONS  0x00000200UL
1877c478bdstevel@tonic-gate
188b106467Jason King/* CKF_TOKEN_INITIALIZED. If it is true, the
189f66d273izick * token has been initialized using C_InitializeToken or an
1907c478bdstevel@tonic-gate * equivalent mechanism outside the scope of PKCS #11.
191f66d273izick * Calling C_InitializeToken when this flag is set will cause
192b106467Jason King * the token to be reinitialized.
193b106467Jason King */
194b106467Jason King#define CKF_TOKEN_INITIALIZED       0x00000400UL
1957c478bdstevel@tonic-gate
196b106467Jason King/* CKF_SECONDARY_AUTHENTICATION. If it is
197f66d273izick * true, the token supports secondary authentication for
198b106467Jason King * private key objects.
199b106467Jason King */
200b106467Jason King#define CKF_SECONDARY_AUTHENTICATION  0x00000800UL
2017c478bdstevel@tonic-gate
202b106467Jason King/* CKF_USER_PIN_COUNT_LOW. If it is true, an
203f66d273izick * incorrect user login PIN has been entered at least once
204b106467Jason King * since the last successful authentication.
205b106467Jason King */
206b106467Jason King#define CKF_USER_PIN_COUNT_LOW       0x00010000UL
2077c478bdstevel@tonic-gate
208b106467Jason King/* CKF_USER_PIN_FINAL_TRY. If it is true,
209b106467Jason King * supplying an incorrect user PIN will it to become locked.
210b106467Jason King */
211b106467Jason King#define CKF_USER_PIN_FINAL_TRY       0x00020000UL
2127c478bdstevel@tonic-gate
213b106467Jason King/* CKF_USER_PIN_LOCKED. If it is true, the
214f66d273izick * user PIN has been locked. User login to the token is not
215b106467Jason King * possible.
216b106467Jason King */
217b106467Jason King#define CKF_USER_PIN_LOCKED          0x00040000UL
2187c478bdstevel@tonic-gate
219b106467Jason King/* CKF_USER_PIN_TO_BE_CHANGED. If it is true,
220f66d273izick * the user PIN value is the default value set by token
2217c478bdstevel@tonic-gate * initialization or manufacturing, or the PIN has been
222b106467Jason King * expired by the card.
223b106467Jason King */
224b106467Jason King#define CKF_USER_PIN_TO_BE_CHANGED   0x00080000UL
2257c478bdstevel@tonic-gate
226b106467Jason King/* CKF_SO_PIN_COUNT_LOW. If it is true, an
227f66d273izick * incorrect SO login PIN has been entered at least once since
228b106467Jason King * the last successful authentication.
229b106467Jason King */
230b106467Jason King#define CKF_SO_PIN_COUNT_LOW         0x00100000UL
2317c478bdstevel@tonic-gate
232b106467Jason King/* CKF_SO_PIN_FINAL_TRY. If it is true,
233b106467Jason King * supplying an incorrect SO PIN will it to become locked.
234b106467Jason King */
235b106467Jason King#define CKF_SO_PIN_FINAL_TRY         0x00200000UL
2367c478bdstevel@tonic-gate
237b106467Jason King/* CKF_SO_PIN_LOCKED. If it is true, the SO
2387c478bdstevel@tonic-gate * PIN has been locked. SO login to the token is not possible.
2397c478bdstevel@tonic-gate */
240b106467Jason King#define CKF_SO_PIN_LOCKED            0x00400000UL
2417c478bdstevel@tonic-gate
242b106467Jason King/* CKF_SO_PIN_TO_BE_CHANGED. If it is true,
243f66d273izick * the SO PIN value is the default value set by token
2447c478bdstevel@tonic-gate * initialization or manufacturing, or the PIN has been
245b106467Jason King * expired by the card.
246b106467Jason King */
247b106467Jason King#define CKF_SO_PIN_TO_BE_CHANGED     0x00800000UL
248b106467Jason King
249b106467Jason King#define CKF_ERROR_STATE              0x01000000UL
2507c478bdstevel@tonic-gate
2517c478bdstevel@tonic-gatetypedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR;
2527c478bdstevel@tonic-gate
2537c478bdstevel@tonic-gate
2547c478bdstevel@tonic-gate/* CK_SESSION_HANDLE is a Cryptoki-assigned value that
255b106467Jason King * identifies a session
256b106467Jason King */
2577c478bdstevel@tonic-gatetypedef CK_ULONG          CK_SESSION_HANDLE;
2587c478bdstevel@tonic-gate
259f66d273izicktypedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR;
2607c478bdstevel@tonic-gate
2617c478bdstevel@tonic-gate
2627c478bdstevel@tonic-gate/* CK_USER_TYPE enumerates the types of Cryptoki users */
2637c478bdstevel@tonic-gatetypedef CK_ULONG          CK_USER_TYPE;
2647c478bdstevel@tonic-gate/* Security Officer */
265b106467Jason King#define CKU_SO                  0UL
2667c478bdstevel@tonic-gate/* Normal user */
267b106467Jason King#define CKU_USER                1UL
268b106467Jason King/* Context specific */
269b106467Jason King#define CKU_CONTEXT_SPECIFIC    2UL
2707c478bdstevel@tonic-gate
2717c478bdstevel@tonic-gate/* CK_STATE enumerates the session states */
2727c478bdstevel@tonic-gatetypedef CK_ULONG          CK_STATE;
273b106467Jason King#define CKS_RO_PUBLIC_SESSION   0UL
274b106467Jason King#define CKS_RO_USER_FUNCTIONS   1UL
275b106467Jason King#define CKS_RW_PUBLIC_SESSION   2UL
276b106467Jason King#define CKS_RW_USER_FUNCTIONS   3UL
277b106467Jason King#define CKS_RW_SO_FUNCTIONS     4UL
2787c478bdstevel@tonic-gate
2797c478bdstevel@tonic-gate/* CK_SESSION_INFO provides information about a session */
2807c478bdstevel@tonic-gatetypedef struct CK_SESSION_INFO {
2817c478bdstevel@tonic-gate  CK_SLOT_ID    slotID;
2827c478bdstevel@tonic-gate  CK_STATE      state;
2837c478bdstevel@tonic-gate  CK_FLAGS      flags;          /* see below */
2847c478bdstevel@tonic-gate  CK_ULONG      ulDeviceError;  /* device-dependent error code */
2857c478bdstevel@tonic-gate} CK_SESSION_INFO;
2867c478bdstevel@tonic-gate
2877c478bdstevel@tonic-gate/* The flags are defined in the following table:
2887c478bdstevel@tonic-gate *      Bit Flag                Mask        Meaning
2897c478bdstevel@tonic-gate */
290b106467Jason King#define CKF_RW_SESSION          0x00000002UL /* session is r/w */
291b106467Jason King#define CKF_SERIAL_SESSION      0x00000004UL /* no parallel    */
2927c478bdstevel@tonic-gate
2937c478bdstevel@tonic-gatetypedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR;
2947c478bdstevel@tonic-gate
2957c478bdstevel@tonic-gate
2967c478bdstevel@tonic-gate/* CK_OBJECT_HANDLE is a token-specific identifier for an
297b106467Jason King * object
298b106467Jason King */
2997c478bdstevel@tonic-gatetypedef CK_ULONG          CK_OBJECT_HANDLE;
3007c478bdstevel@tonic-gate
3017c478bdstevel@tonic-gatetypedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR;
3027c478bdstevel@tonic-gate
3037c478bdstevel@tonic-gate
3047c478bdstevel@tonic-gate/* CK_OBJECT_CLASS is a value that identifies the classes (or
3057c478bdstevel@tonic-gate * types) of objects that Cryptoki recognizes.  It is defined
306b106467Jason King * as follows:
307b106467Jason King */
3087c478bdstevel@tonic-gatetypedef CK_ULONG          CK_OBJECT_CLASS;
3097c478bdstevel@tonic-gate
3107c478bdstevel@tonic-gate/* The following classes of objects are defined: */
311b106467Jason King#define CKO_DATA              0x00000000UL
312b106467Jason King#define CKO_CERTIFICATE       0x00000001UL
313b106467Jason King#define CKO_PUBLIC_KEY        0x00000002UL
314b106467Jason King#define CKO_PRIVATE_KEY       0x00000003UL
315b106467Jason King#define CKO_SECRET_KEY        0x00000004UL
316b106467Jason King#define CKO_HW_FEATURE        0x00000005UL
317b106467Jason King#define CKO_DOMAIN_PARAMETERS 0x00000006UL
318b106467Jason King#define CKO_MECHANISM         0x00000007UL
319b106467Jason King#define CKO_OTP_KEY           0x00000008UL
320b106467Jason King
321b106467Jason King#define CKO_VENDOR_DEFINED    0x80000000UL
3227c478bdstevel@tonic-gate
3237c478bdstevel@tonic-gatetypedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR;
3247c478bdstevel@tonic-gate
325b106467Jason King/* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type
326b106467Jason King * of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE.
327b106467Jason King */
3287c478bdstevel@tonic-gatetypedef CK_ULONG          CK_HW_FEATURE_TYPE;
329f66d273izick
3307c478bdstevel@tonic-gate/* The following hardware feature types are defined */
331b106467Jason King#define CKH_MONOTONIC_COUNTER  0x00000001UL
332b106467Jason King#define CKH_CLOCK              0x00000002UL
333b106467Jason King#define CKH_USER_INTERFACE     0x00000003UL
334b106467Jason King#define CKH_VENDOR_DEFINED     0x80000000UL
3357c478bdstevel@tonic-gate
3367c478bdstevel@tonic-gate/* CK_KEY_TYPE is a value that identifies a key type */
3377c478bdstevel@tonic-gatetypedef CK_ULONG          CK_KEY_TYPE;
3387c478bdstevel@tonic-gate
3397c478bdstevel@tonic-gate/* the following key types are defined: */
340b106467Jason King#define CKK_RSA                 0x00000000UL
341b106467Jason King#define CKK_DSA                 0x00000001UL
342b106467Jason King#define CKK_DH                  0x00000002UL
343b106467Jason King#define CKK_ECDSA               0x00000003UL /* Deprecated */
344b106467Jason King#define CKK_EC                  0x00000003UL
345b106467Jason King#define CKK_X9_42_DH            0x00000004UL
346b106467Jason King#define CKK_KEA                 0x00000005UL
347b106467Jason King#define CKK_GENERIC_SECRET      0x00000010UL
348b106467Jason King#define CKK_RC2                 0x00000011UL
349b106467Jason King#define CKK_RC4                 0x00000012UL
350b106467Jason King#define CKK_DES                 0x00000013UL
351b106467Jason King#define CKK_DES2                0x00000014UL
352b106467Jason King#define CKK_DES3                0x00000015UL
353b106467Jason King#define CKK_CAST                0x00000016UL
354b106467Jason King#define CKK_CAST3               0x00000017UL
355b106467Jason King#define CKK_CAST5               0x00000018UL /* Deprecated */
356b106467Jason King#define CKK_CAST128             0x00000018UL
357b106467Jason King#define CKK_RC5                 0x00000019UL
358b106467Jason King#define CKK_IDEA                0x0000001AUL
359b106467Jason King#define CKK_SKIPJACK            0x0000001BUL
360b106467Jason King#define CKK_BATON               0x0000001CUL
361b106467Jason King#define CKK_JUNIPER             0x0000001DUL
362b106467Jason King#define CKK_CDMF                0x0000001EUL
363b106467Jason King#define CKK_AES                 0x0000001FUL
364b106467Jason King#define CKK_BLOWFISH            0x00000020UL
365b106467Jason King#define CKK_TWOFISH             0x00000021UL
366b106467Jason King#define CKK_SECURID             0x00000022UL
367b106467Jason King#define CKK_HOTP                0x00000023UL
368b106467Jason King#define CKK_ACTI                0x00000024UL
369b106467Jason King#define CKK_CAMELLIA            0x00000025UL
370b106467Jason King#define CKK_ARIA                0x00000026UL
371b106467Jason King
372b106467Jason King#define CKK_MD5_HMAC            0x00000027UL
373b106467Jason King#define CKK_SHA_1_HMAC          0x00000028UL
374b106467Jason King#define CKK_RIPEMD128_HMAC      0x00000029UL
375b106467Jason King#define CKK_RIPEMD160_HMAC      0x0000002AUL
376b106467Jason King#define CKK_SHA256_HMAC         0x0000002BUL
377b106467Jason King#define CKK_SHA384_HMAC         0x0000002CUL
378b106467Jason King#define CKK_SHA512_HMAC         0x0000002DUL
379b106467Jason King#define CKK_SHA224_HMAC         0x0000002EUL
380b106467Jason King
381b106467Jason King#define CKK_SEED                0x0000002FUL
382b106467Jason King#define CKK_GOSTR3410           0x00000030UL
383b106467Jason King#define CKK_GOSTR3411           0x00000031UL
384b106467Jason King#define CKK_GOST28147           0x00000032UL
385b106467Jason King
386b106467Jason King
387b106467Jason King
388b106467Jason King#define CKK_VENDOR_DEFINED      0x80000000UL
3897c478bdstevel@tonic-gate
3907c478bdstevel@tonic-gate
3917c478bdstevel@tonic-gate/* CK_CERTIFICATE_TYPE is a value that identifies a certificate
392b106467Jason King * type
393b106467Jason King */
3947c478bdstevel@tonic-gatetypedef CK_ULONG          CK_CERTIFICATE_TYPE;
3957c478bdstevel@tonic-gate
396b106467Jason King#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED     0UL
397b106467Jason King#define CK_CERTIFICATE_CATEGORY_TOKEN_USER      1UL
398b106467Jason King#define CK_CERTIFICATE_CATEGORY_AUTHORITY       2UL
399b106467Jason King#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY    3UL
400b106467Jason King
401b106467Jason King#define CK_SECURITY_DOMAIN_UNSPECIFIED     0UL
402b106467Jason King#define CK_SECURITY_DOMAIN_MANUFACTURER    1UL
403b106467Jason King#define CK_SECURITY_DOMAIN_OPERATOR        2UL
404b106467Jason King#define CK_SECURITY_DOMAIN_THIRD_PARTY     3UL
405b106467Jason King
406b106467Jason King
4077c478bdstevel@tonic-gate/* The following certificate types are defined: */
408b106467Jason King#define CKC_X_509               0x00000000UL
409b106467Jason King#define CKC_X_509_ATTR_CERT     0x00000001UL
410b106467Jason King#define CKC_WTLS                0x00000002UL
411b106467Jason King#define CKC_VENDOR_DEFINED      0x80000000UL
4127c478bdstevel@tonic-gate
4137c478bdstevel@tonic-gate
4147c478bdstevel@tonic-gate/* CK_ATTRIBUTE_TYPE is a value that identifies an attribute
415b106467Jason King * type
416b106467Jason King */
4177c478bdstevel@tonic-gatetypedef CK_ULONG          CK_ATTRIBUTE_TYPE;
4187c478bdstevel@tonic-gate
419f66d273izick/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which
420b106467Jason King * consists of an array of values.
421b106467Jason King */
422b106467Jason King#define CKF_ARRAY_ATTRIBUTE     0x40000000UL
423b106467Jason King
424b106467Jason King/* The following OTP-related defines relate to the CKA_OTP_FORMAT attribute */
425b106467Jason King#define CK_OTP_FORMAT_DECIMAL           0UL
426b106467Jason King#define CK_OTP_FORMAT_HEXADECIMAL       1UL
427b106467Jason King#define CK_OTP_FORMAT_ALPHANUMERIC      2UL
428b106467Jason King#define CK_OTP_FORMAT_BINARY            3UL
429b106467Jason King
430b106467Jason King/* The following OTP-related defines relate to the CKA_OTP_..._REQUIREMENT
431b106467Jason King * attributes
432b106467Jason King */
433b106467Jason King#define CK_OTP_PARAM_IGNORED            0UL
434b106467Jason King#define CK_OTP_PARAM_OPTIONAL           1UL
435b106467Jason King#define CK_OTP_PARAM_MANDATORY          2UL
4361e9884amcpowers
4377c478bdstevel@tonic-gate/* The following attribute types are defined: */
438b106467Jason King#define CKA_CLASS              0x00000000UL
439b106467Jason King#define CKA_TOKEN              0x00000001UL
440b106467Jason King#define CKA_PRIVATE            0x00000002UL
441b106467Jason King#define CKA_LABEL              0x00000003UL
442b106467Jason King#define CKA_APPLICATION        0x00000010UL
443b106467Jason King#define CKA_VALUE              0x00000011UL
444b106467Jason King#define CKA_OBJECT_ID          0x00000012UL
445b106467Jason King#define CKA_CERTIFICATE_TYPE   0x00000080UL
446b106467Jason King#define CKA_ISSUER             0x00000081UL
447b106467Jason King#define CKA_SERIAL_NUMBER      0x00000082UL
448b106467Jason King#define CKA_AC_ISSUER          0x00000083UL
449b106467Jason King#define CKA_OWNER              0x00000084UL
450b106467Jason King#define CKA_ATTR_TYPES         0x00000085UL
451b106467Jason King#define CKA_TRUSTED            0x00000086UL
452b106467Jason King#define CKA_CERTIFICATE_CATEGORY        0x00000087UL
453b106467Jason King#define CKA_JAVA_MIDP_SECURITY_DOMAIN   0x00000088UL
454b106467Jason King#define CKA_URL                         0x00000089UL
455b106467Jason King#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY  0x0000008AUL
456b106467Jason King#define CKA_HASH_OF_ISSUER_PUBLIC_KEY   0x0000008BUL
457b106467Jason King#define CKA_NAME_HASH_ALGORITHM         0x0000008CUL
458b106467Jason King#define CKA_CHECK_VALUE                 0x00000090UL
459b106467Jason King
460b106467Jason King#define CKA_KEY_TYPE           0x00000100UL
461b106467Jason King#define CKA_SUBJECT            0x00000101UL
462b106467Jason King#define CKA_ID                 0x00000102UL
463b106467Jason King#define CKA_SENSITIVE          0x00000103UL
464b106467Jason King#define CKA_ENCRYPT            0x00000104UL
465b106467Jason King#define CKA_DECRYPT            0x00000105UL
466b106467Jason King#define CKA_WRAP               0x00000106UL
467b106467Jason King#define CKA_UNWRAP             0x00000107UL
468b106467Jason King#define CKA_SIGN               0x00000108UL
469b106467Jason King#define CKA_SIGN_RECOVER       0x00000109UL
470b106467Jason King#define CKA_VERIFY             0x0000010AUL
471b106467Jason King#define CKA_VERIFY_RECOVER     0x0000010BUL
472b106467Jason King#define CKA_DERIVE             0x0000010CUL
473b106467Jason King#define CKA_START_DATE         0x00000110UL
474b106467Jason King#define CKA_END_DATE           0x00000111UL
475b106467Jason King#define CKA_MODULUS            0x00000120UL
476b106467Jason King#define CKA_MODULUS_BITS       0x00000121UL
477b106467Jason King#define CKA_PUBLIC_EXPONENT    0x00000122UL
478b106467Jason King#define CKA_PRIVATE_EXPONENT   0x00000123UL
479b106467Jason King#define CKA_PRIME_1            0x00000124UL
480b106467Jason King#define CKA_PRIME_2            0x00000125UL
481b106467Jason King#define CKA_EXPONENT_1         0x00000126UL
482b106467Jason King#define CKA_EXPONENT_2         0x00000127UL
483b106467Jason King#define CKA_COEFFICIENT        0x00000128UL
484b106467Jason King#define CKA_PUBLIC_KEY_INFO    0x00000129UL
485b106467Jason King#define CKA_PRIME              0x00000130UL
486b106467Jason King#define CKA_SUBPRIME           0x00000131UL
487b106467Jason King#define CKA_BASE               0x00000132UL
488b106467Jason King
489b106467Jason King#define CKA_PRIME_BITS         0x00000133UL
490b106467Jason King#define CKA_SUBPRIME_BITS      0x00000134UL
491f66d273izick#define CKA_SUB_PRIME_BITS     CKA_SUBPRIME_BITS
492b106467Jason King
493b106467Jason King#define CKA_VALUE_BITS         0x00000160UL
494b106467Jason King#define CKA_VALUE_LEN          0x00000161UL
495b106467Jason King#define CKA_EXTRACTABLE        0x00000162UL
496b106467Jason King#define CKA_LOCAL              0x00000163UL
497b106467Jason King#define CKA_NEVER_EXTRACTABLE  0x00000164UL
498b106467Jason King#define CKA_ALWAYS_SENSITIVE   0x00000165UL
499b106467Jason King#define CKA_KEY_GEN_MECHANISM  0x00000166UL
500b106467Jason King
501b106467Jason King#define CKA_MODIFIABLE         0x00000170UL
502b106467Jason King#define CKA_COPYABLE           0x00000171UL
503b106467Jason King
504b106467Jason King#define CKA_DESTROYABLE        0x00000172UL
505b106467Jason King
506b106467Jason King#define CKA_ECDSA_PARAMS       0x00000180UL /* Deprecated */
507b106467Jason King#define CKA_EC_PARAMS          0x00000180UL
508b106467Jason King
509b106467Jason King#define CKA_EC_POINT           0x00000181UL
510b106467Jason King
511b106467Jason King#define CKA_SECONDARY_AUTH     0x00000200UL /* Deprecated */
512b106467Jason King#define CKA_AUTH_PIN_FLAGS     0x00000201UL /* Deprecated */
513b106467Jason King
514b106467Jason King#define CKA_ALWAYS_AUTHENTICATE  0x00000202UL
515b106467Jason King
516b106467Jason King#define CKA_WRAP_WITH_TRUSTED    0x00000210UL
517b106467Jason King#define CKA_WRAP_TEMPLATE        (CKF_ARRAY_ATTRIBUTE|0x00000211UL)
518b106467Jason King#define CKA_UNWRAP_TEMPLATE      (CKF_ARRAY_ATTRIBUTE|0x00000212UL)
519b106467Jason King#define CKA_DERIVE_TEMPLATE      (CKF_ARRAY_ATTRIBUTE|0x00000213UL)
520b106467Jason King
521b106467Jason King#define CKA_OTP_FORMAT                0x00000220UL
522b106467Jason King#define CKA_OTP_LENGTH                0x00000221UL
523b106467Jason King#define CKA_OTP_TIME_INTERVAL         0x00000222UL
524b106467Jason King#define CKA_OTP_USER_FRIENDLY_MODE    0x00000223UL
525b106467Jason King#define CKA_OTP_CHALLENGE_REQUIREMENT 0x00000224UL
526b106467Jason King#define CKA_OTP_TIME_REQUIREMENT      0x00000225UL
527b106467Jason King#define CKA_OTP_COUNTER_REQUIREMENT   0x00000226UL
528b106467Jason King#define CKA_OTP_PIN_REQUIREMENT       0x00000227UL
529b106467Jason King#define CKA_OTP_COUNTER               0x0000022EUL
530b106467Jason King#define CKA_OTP_TIME                  0x0000022FUL
531b106467Jason King#define CKA_OTP_USER_IDENTIFIER       0x0000022AUL
532b106467Jason King#define CKA_OTP_SERVICE_IDENTIFIER    0x0000022BUL
533b106467Jason King#define CKA_OTP_SERVICE_LOGO          0x0000022CUL
534b106467Jason King#define CKA_OTP_SERVICE_LOGO_TYPE     0x0000022DUL
535b106467Jason King
536b106467Jason King#define CKA_GOSTR3410_PARAMS            0x00000250UL
537b106467Jason King#define CKA_GOSTR3411_PARAMS            0x00000251UL
538b106467Jason King#define CKA_GOST28147_PARAMS            0x00000252UL
539b106467Jason King
540b106467Jason King#define CKA_HW_FEATURE_TYPE             0x00000300UL
541b106467Jason King#define CKA_RESET_ON_INIT               0x00000301UL
542b106467Jason King#define CKA_HAS_RESET                   0x00000302UL
543b106467Jason King
544b106467Jason King#define CKA_PIXEL_X                     0x00000400UL
545b106467Jason King#define CKA_PIXEL_Y                     0x00000401UL
546b106467Jason King#define CKA_RESOLUTION                  0x00000402UL
547b106467Jason King#define CKA_CHAR_ROWS                   0x00000403UL
548b106467Jason King#define CKA_CHAR_COLUMNS                0x00000404UL
549b106467Jason King#define CKA_COLOR                       0x00000405UL
550b106467Jason King#define CKA_BITS_PER_PIXEL              0x00000406UL
551b106467Jason King#define CKA_CHAR_SETS                   0x00000480UL
552b106467Jason King#define CKA_ENCODING_METHODS            0x00000481UL
553b106467Jason King#define CKA_MIME_TYPES                  0x00000482UL
554b106467Jason King#define CKA_MECHANISM_TYPE              0x00000500UL
555b106467Jason King#define CKA_REQUIRED_CMS_ATTRIBUTES     0x00000501UL
556b106467Jason King#define CKA_DEFAULT_CMS_ATTRIBUTES      0x00000502UL
557b106467Jason King#define CKA_SUPPORTED_CMS_ATTRIBUTES    0x00000503UL
558b106467Jason King#define CKA_ALLOWED_MECHANISMS          (CKF_ARRAY_ATTRIBUTE|0x00000600UL)
559b106467Jason King
560b106467Jason King#define CKA_VENDOR_DEFINED              0x80000000UL
5617c478bdstevel@tonic-gate
5627c478bdstevel@tonic-gate/* CK_ATTRIBUTE is a structure that includes the type, length
563b106467Jason King * and value of an attribute
564b106467Jason King */
5657c478bdstevel@tonic-gatetypedef struct CK_ATTRIBUTE {
5667c478bdstevel@tonic-gate  CK_ATTRIBUTE_TYPE type;
5677c478bdstevel@tonic-gate  CK_VOID_PTR       pValue;
5687c478bdstevel@tonic-gate  CK_ULONG          ulValueLen;  /* in bytes */
5697c478bdstevel@tonic-gate} CK_ATTRIBUTE;
5707c478bdstevel@tonic-gate
5717c478bdstevel@tonic-gatetypedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR;
5727c478bdstevel@tonic-gate
5737c478bdstevel@tonic-gate/* CK_DATE is a structure that defines a date */
5747c478bdstevel@tonic-gatetypedef struct CK_DATE{
5757c478bdstevel@tonic-gate  CK_CHAR       year[4];   /* the year ("1900" - "9999") */
5767c478bdstevel@tonic-gate  CK_CHAR       month[2];  /* the month ("01" - "12") */
5777c478bdstevel@tonic-gate  CK_CHAR       day[2];    /* the day   ("01" - "31") */
5787c478bdstevel@tonic-gate} CK_DATE;
5797c478bdstevel@tonic-gate
5807c478bdstevel@tonic-gate
5817c478bdstevel@tonic-gate/* CK_MECHANISM_TYPE is a value that identifies a mechanism
582b106467Jason King * type
583b106467Jason King */
5847c478bdstevel@tonic-gatetypedef CK_ULONG          CK_MECHANISM_TYPE;
5857c478bdstevel@tonic-gate
5867c478bdstevel@tonic-gate/* the following mechanism types are defined: */
587b106467Jason King#define CKM_RSA_PKCS_KEY_PAIR_GEN      0x00000000UL
588b106467Jason King#define CKM_RSA_PKCS                   0x00000001UL
589b106467Jason King#define CKM_RSA_9796                   0x00000002UL
590b106467Jason King#define CKM_RSA_X_509                  0x00000003UL
591b106467Jason King
592b106467Jason King#define CKM_MD2_RSA_PKCS               0x00000004UL
593b106467Jason King#define CKM_MD5_RSA_PKCS               0x00000005UL
594b106467Jason King#define CKM_SHA1_RSA_PKCS              0x00000006UL
595b106467Jason King
596b106467Jason King#define CKM_RIPEMD128_RSA_PKCS         0x00000007UL
597b106467Jason King#define CKM_RIPEMD160_RSA_PKCS         0x00000008UL
598b106467Jason King#define CKM_RSA_PKCS_OAEP              0x00000009UL
599b106467Jason King
600b106467Jason King#define CKM_RSA_X9_31_KEY_PAIR_GEN     0x0000000AUL
601b106467Jason King#define CKM_RSA_X9_31                  0x0000000BUL
602b106467Jason King#define CKM_SHA1_RSA_X9_31             0x0000000CUL
603b106467Jason King#define CKM_RSA_PKCS_PSS               0x0000000DUL
604b106467Jason King#define CKM_SHA1_RSA_PKCS_PSS          0x0000000EUL
605b106467Jason King
606b106467Jason King#define CKM_DSA_KEY_PAIR_GEN           0x00000010UL
607b106467Jason King#define CKM_DSA                        0x00000011UL
608b106467Jason King#define CKM_DSA_SHA1                   0x00000012UL
609b106467Jason King#define CKM_DSA_SHA224                 0x00000013UL
610b106467Jason King#define CKM_DSA_SHA256                 0x00000014UL
611b106467Jason King#define CKM_DSA_SHA384                 0x00000015UL
612b106467Jason King#define CKM_DSA_SHA512                 0x00000016UL
613b106467Jason King
614b106467Jason King#define CKM_DH_PKCS_KEY_PAIR_GEN       0x00000020UL
615b106467Jason King#define CKM_DH_PKCS_DERIVE             0x00000021UL
616b106467Jason King
617b106467Jason King#define CKM_X9_42_DH_KEY_PAIR_GEN      0x00000030UL
618b106467Jason King#define CKM_X9_42_DH_DERIVE            0x00000031UL
619b106467Jason King#define CKM_X9_42_DH_HYBRID_DERIVE     0x00000032UL
620b106467Jason King#define CKM_X9_42_MQV_DERIVE           0x00000033UL
621b106467Jason King
622b106467Jason King#define CKM_SHA256_RSA_PKCS            0x00000040UL
623b106467Jason King#define CKM_SHA384_RSA_PKCS            0x00000041UL
624b106467Jason King#define CKM_SHA512_RSA_PKCS            0x00000042UL
625b106467Jason King#define CKM_SHA256_RSA_PKCS_PSS        0x00000043UL
626b106467Jason King#define CKM_SHA384_RSA_PKCS_PSS        0x00000044UL
627b106467Jason King#define CKM_SHA512_RSA_PKCS_PSS        0x00000045UL
628b106467Jason King
629b106467Jason King#define CKM_SHA224_RSA_PKCS            0x00000046UL
630b106467Jason King#define CKM_SHA224_RSA_PKCS_PSS        0x00000047UL
631b106467Jason King
632b106467Jason King#define CKM_SHA512_224                 0x00000048UL
633b106467Jason King#define CKM_SHA512_224_HMAC            0x00000049UL
634b106467Jason King#define CKM_SHA512_224_HMAC_GENERAL    0x0000004AUL
635b106467Jason King#define CKM_SHA512_224_KEY_DERIVATION  0x0000004BUL
636b106467Jason King#define CKM_SHA512_256                 0x0000004CUL
637b106467Jason King#define CKM_SHA512_256_HMAC            0x0000004DUL
638b106467Jason King#define CKM_SHA512_256_HMAC_GENERAL    0x0000004EUL
639b106467Jason King#define CKM_SHA512_256_KEY_DERIVATION  0x0000004FUL
640b106467Jason King
641b106467Jason King#define CKM_SHA512_T                   0x00000050UL
642b106467Jason King#define CKM_SHA512_T_HMAC              0x00000051UL
643b106467Jason King#define CKM_SHA512_T_HMAC_GENERAL      0x00000052UL
644b106467Jason King#define CKM_SHA512_T_KEY_DERIVATION    0x00000053UL
645b106467Jason King
646b106467Jason King#define CKM_RC2_KEY_GEN                0x00000100UL
647b106467Jason King#define CKM_RC2_ECB                    0x00000101UL
648b106467Jason King#define CKM_RC2_CBC                    0x00000102UL
649b106467Jason King#define CKM_RC2_MAC                    0x00000103UL
650b106467Jason King
651b106467Jason King#define CKM_RC2_MAC_GENERAL            0x00000104UL
652b106467Jason King#define CKM_RC2_CBC_PAD                0x00000105UL
653b106467Jason King
654b106467Jason King#define CKM_RC4_KEY_GEN                0x00000110UL
655b106467Jason King#define CKM_RC4                        0x00000111UL
656b106467Jason King#define CKM_DES_KEY_GEN                0x00000120UL
657b106467Jason King#define CKM_DES_ECB                    0x00000121UL
658b106467Jason King#define CKM_DES_CBC                    0x00000122UL
659b106467Jason King#define CKM_DES_MAC                    0x00000123UL
660b106467Jason King
661b106467Jason King#define CKM_DES_MAC_GENERAL            0x00000124UL
662b106467Jason King#define CKM_DES_CBC_PAD                0x00000125UL
663b106467Jason King
664b106467Jason King#define CKM_DES2_KEY_GEN               0x00000130UL
665b106467Jason King#define CKM_DES3_KEY_GEN               0x00000131UL
666b106467Jason King#define CKM_DES3_ECB                   0x00000132UL
667b106467Jason King#define CKM_DES3_CBC                   0x00000133UL
668b106467Jason King#define CKM_DES3_MAC                   0x00000134UL
669b106467Jason King
670b106467Jason King#define CKM_DES3_MAC_GENERAL           0x00000135UL
671b106467Jason King#define CKM_DES3_CBC_PAD               0x00000136UL
672b106467Jason King#define CKM_DES3_CMAC_GENERAL          0x00000137UL
673b106467Jason King#define CKM_DES3_CMAC                  0x00000138UL
674b106467Jason King#define CKM_CDMF_KEY_GEN               0x00000140UL
675b106467Jason King#define CKM_CDMF_ECB                   0x00000141UL
676b106467Jason King#define CKM_CDMF_CBC                   0x00000142UL
677b106467Jason King#define CKM_CDMF_MAC                   0x00000143UL
678b106467Jason King#define CKM_CDMF_MAC_GENERAL           0x00000144UL
679b106467Jason King#define CKM_CDMF_CBC_PAD               0x00000145UL
680b106467Jason King
681b106467Jason King#define CKM_DES_OFB64                  0x00000150UL
682b106467Jason King#define CKM_DES_OFB8                   0x00000151UL
683b106467Jason King#define CKM_DES_CFB64                  0x00000152UL
684b106467Jason King#define CKM_DES_CFB8                   0x00000153UL
685b106467Jason King
686b106467Jason King#define CKM_MD2                        0x00000200UL
687b106467Jason King
688b106467Jason King#define CKM_MD2_HMAC                   0x00000201UL
689b106467Jason King#define CKM_MD2_HMAC_GENERAL           0x00000202UL
690b106467Jason King
691b106467Jason King#define CKM_MD5                        0x00000210UL
692b106467Jason King
693b106467Jason King#define CKM_MD5_HMAC                   0x00000211UL
694b106467Jason King#define CKM_MD5_HMAC_GENERAL           0x00000212UL
695b106467Jason King
696b106467Jason King#define CKM_SHA_1                      0x00000220UL
697b106467Jason King
698b106467Jason King#define CKM_SHA_1_HMAC                 0x00000221UL
699b106467Jason King#define CKM_SHA_1_HMAC_GENERAL         0x00000222UL
700b106467Jason King
701b106467Jason King#define CKM_RIPEMD128                  0x00000230UL
702b106467Jason King#define CKM_RIPEMD128_HMAC             0x00000231UL
703b106467Jason King#define CKM_RIPEMD128_HMAC_GENERAL     0x00000232UL
704b106467Jason King#define CKM_RIPEMD160                  0x00000240UL
705b106467Jason King#define CKM_RIPEMD160_HMAC             0x00000241UL
706b106467Jason King#define CKM_RIPEMD160_HMAC_GENERAL     0x00000242UL
707b106467Jason King
708b106467Jason King#define CKM_SHA256                     0x00000250UL
709b106467Jason King#define CKM_SHA256_HMAC                0x00000251UL
710b106467Jason King#define CKM_SHA256_HMAC_GENERAL        0x00000252UL
711b106467Jason King#define CKM_SHA224                     0x00000255UL
712b106467Jason King#define CKM_SHA224_HMAC                0x00000256UL
713b106467Jason King#define CKM_SHA224_HMAC_GENERAL        0x00000257UL
714b106467Jason King#define CKM_SHA384                     0x00000260UL
715b106467Jason King#define CKM_SHA384_HMAC                0x00000261UL
716b106467Jason King#define CKM_SHA384_HMAC_GENERAL        0x00000262UL
717b106467Jason King#define CKM_SHA512                     0x00000270UL
718b106467Jason King#define CKM_SHA512_HMAC                0x00000271UL
719b106467Jason King#define CKM_SHA512_HMAC_GENERAL        0x00000272UL
720b106467Jason King#define CKM_SECURID_KEY_GEN            0x00000280UL
721b106467Jason King#define CKM_SECURID                    0x00000282UL
722b106467Jason King#define CKM_HOTP_KEY_GEN               0x00000290UL
723b106467Jason King#define CKM_HOTP                       0x00000291UL
724b106467Jason King#define CKM_ACTI                       0x000002A0UL
725b106467Jason King#define CKM_ACTI_KEY_GEN               0x000002A1UL
726b106467Jason King
727b106467Jason King#define CKM_CAST_KEY_GEN               0x00000300UL
728b106467Jason King#define CKM_CAST_ECB                   0x00000301UL
729b106467Jason King#define CKM_CAST_CBC                   0x00000302UL
730b106467Jason King#define CKM_CAST_MAC                   0x00000303UL
731b106467Jason King#define CKM_CAST_MAC_GENERAL           0x00000304UL
732b106467Jason King#define CKM_CAST_CBC_PAD               0x00000305UL
733b106467Jason King#define CKM_CAST3_KEY_GEN              0x00000310UL
734b106467Jason King#define CKM_CAST3_ECB                  0x00000311UL
735b106467Jason King#define CKM_CAST3_CBC                  0x00000312UL
736b106467Jason King#define CKM_CAST3_MAC                  0x00000313UL
737b106467Jason King#define CKM_CAST3_MAC_GENERAL          0x00000314UL
738b106467Jason King#define CKM_CAST3_CBC_PAD              0x00000315UL
7397c478bdstevel@tonic-gate/* Note that CAST128 and CAST5 are the same algorithm */
740b106467Jason King#define CKM_CAST5_KEY_GEN              0x00000320UL
741b106467Jason King#define CKM_CAST128_KEY_GEN            0x00000320UL
742b106467Jason King#define CKM_CAST5_ECB                  0x00000321UL
743b106467Jason King#define CKM_CAST128_ECB                0x00000321UL
744b106467Jason King#define CKM_CAST5_CBC                  0x00000322UL /* Deprecated */
745b106467Jason King#define CKM_CAST128_CBC                0x00000322UL
746b106467Jason King#define CKM_CAST5_MAC                  0x00000323UL /* Deprecated */
747b106467Jason King#define CKM_CAST128_MAC                0x00000323UL
748b106467Jason King#define CKM_CAST5_MAC_GENERAL          0x00000324UL /* Deprecated */
749b106467Jason King#define CKM_CAST128_MAC_GENERAL        0x00000324UL
750b106467Jason King#define CKM_CAST5_CBC_PAD              0x00000325UL /* Deprecated */
751b106467Jason King#define CKM_CAST128_CBC_PAD            0x00000325UL
752b106467Jason King#define CKM_RC5_KEY_GEN                0x00000330UL
753b106467Jason King#define CKM_RC5_ECB                    0x00000331UL
754b106467Jason King#define CKM_RC5_CBC                    0x00000332UL
755b106467Jason King#define CKM_RC5_MAC                    0x00000333UL
756b106467Jason King#define CKM_RC5_MAC_GENERAL            0x00000334UL
757b106467Jason King#define CKM_RC5_CBC_PAD                0x00000335UL
758b106467Jason King#define CKM_IDEA_KEY_GEN               0x00000340UL
759b106467Jason King#define CKM_IDEA_ECB                   0x00000341UL
760b106467Jason King#define CKM_IDEA_CBC                   0x00000342UL
761b106467Jason King#define CKM_IDEA_MAC                   0x00000343UL
762b106467Jason King#define CKM_IDEA_MAC_GENERAL           0x00000344UL
763b106467Jason King#define CKM_IDEA_CBC_PAD               0x00000345UL
764b106467Jason King#define CKM_GENERIC_SECRET_KEY_GEN     0x00000350UL
765b106467Jason King#define CKM_CONCATENATE_BASE_AND_KEY   0x00000360UL
766b106467Jason King#define CKM_CONCATENATE_BASE_AND_DATA  0x00000362UL
767b106467Jason King#define CKM_CONCATENATE_DATA_AND_BASE  0x00000363UL
768b106467Jason King#define CKM_XOR_BASE_AND_DATA          0x00000364UL
769b106467Jason King#define CKM_EXTRACT_KEY_FROM_KEY       0x00000365UL
770b106467Jason King#define CKM_SSL3_PRE_MASTER_KEY_GEN    0x00000370UL
771b106467Jason King#define CKM_SSL3_MASTER_KEY_DERIVE     0x00000371UL
772b106467Jason King#define CKM_SSL3_KEY_AND_MAC_DERIVE    0x00000372UL
773b106467Jason King
774b106467Jason King#define CKM_SSL3_MASTER_KEY_DERIVE_DH  0x00000373UL
775b106467Jason King#define CKM_TLS_PRE_MASTER_KEY_GEN     0x00000374UL
776b106467Jason King#define CKM_TLS_MASTER_KEY_DERIVE      0x00000375UL
777b106467Jason King#define CKM_TLS_KEY_AND_MAC_DERIVE     0x00000376UL
778b106467Jason King#define CKM_TLS_MASTER_KEY_DERIVE_DH   0x00000377UL
779b106467Jason King
780b106467Jason King#define CKM_TLS_PRF                    0x00000378UL
781b106467Jason King
782b106467Jason King#define CKM_SSL3_MD5_MAC               0x00000380UL
783b106467Jason King#define CKM_SSL3_SHA1_MAC              0x00000381UL
784b106467Jason King#define CKM_MD5_KEY_DERIVATION         0x00000390UL
785b106467Jason King#define CKM_MD2_KEY_DERIVATION         0x00000391UL
786b106467Jason King#define CKM_SHA1_KEY_DERIVATION        0x00000392UL
787b106467Jason King
788b106467Jason King#define CKM_SHA256_KEY_DERIVATION      0x00000393UL
789b106467Jason King#define CKM_SHA384_KEY_DERIVATION      0x00000394UL
790b106467Jason King#define CKM_SHA512_KEY_DERIVATION      0x00000395UL
791b106467Jason King#define CKM_SHA224_KEY_DERIVATION      0x00000396UL
792b106467Jason King
793b106467Jason King#define CKM_PBE_MD2_DES_CBC            0x000003A0UL
794b106467Jason King#define CKM_PBE_MD5_DES_CBC            0x000003A1UL
795b106467Jason King#define CKM_PBE_MD5_CAST_CBC           0x000003A2UL
796b106467Jason King#define CKM_PBE_MD5_CAST3_CBC          0x000003A3UL
797b106467Jason King#define CKM_PBE_MD5_CAST5_CBC          0x000003A4UL /* Deprecated */
798b106467Jason King#define CKM_PBE_MD5_CAST128_CBC        0x000003A4UL
799b106467Jason King#define CKM_PBE_SHA1_CAST5_CBC         0x000003A5UL /* Deprecated */
800b106467Jason King#define CKM_PBE_SHA1_CAST128_CBC       0x000003A5UL
801b106467Jason King#define CKM_PBE_SHA1_RC4_128           0x000003A6UL
802b106467Jason King#define CKM_PBE_SHA1_RC4_40            0x000003A7UL
803b106467Jason King#define CKM_PBE_SHA1_DES3_EDE_CBC      0x000003A8UL
804b106467Jason King#define CKM_PBE_SHA1_DES2_EDE_CBC      0x000003A9UL
805b106467Jason King#define CKM_PBE_SHA1_RC2_128_CBC       0x000003AAUL
806b106467Jason King#define CKM_PBE_SHA1_RC2_40_CBC        0x000003ABUL
807b106467Jason King
808b106467Jason King#define CKM_PKCS5_PBKD2                0x000003B0UL
809b106467Jason King
810b106467Jason King#define CKM_PBA_SHA1_WITH_SHA1_HMAC    0x000003C0UL
811b106467Jason King
812b106467Jason King#define CKM_WTLS_PRE_MASTER_KEY_GEN         0x000003D0UL
813b106467Jason King#define CKM_WTLS_MASTER_KEY_DERIVE          0x000003D1UL
814b106467Jason King#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC   0x000003D2UL
815b106467Jason King#define CKM_WTLS_PRF                        0x000003D3UL
816b106467Jason King#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE  0x000003D4UL
817b106467Jason King#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE  0x000003D5UL
818b106467Jason King
819b106467Jason King#define CKM_TLS10_MAC_SERVER                0x000003D6UL
820b106467Jason King#define CKM_TLS10_MAC_CLIENT                0x000003D7UL
821b106467Jason King#define CKM_TLS12_MAC                       0x000003D8UL
822b106467Jason King#define CKM_TLS12_KDF                       0x000003D9UL
823b106467Jason King#define CKM_TLS12_MASTER_KEY_DERIVE         0x000003E0UL
824b106467Jason King#define CKM_TLS12_KEY_AND_MAC_DERIVE        0x000003E1UL
825b106467Jason King#define CKM_TLS12_MASTER_KEY_DERIVE_DH      0x000003E2UL
826b106467Jason King#define CKM_TLS12_KEY_SAFE_DERIVE           0x000003E3UL
827b106467Jason King#define CKM_TLS_MAC                         0x000003E4UL
828b106467Jason King#define CKM_TLS_KDF                         0x000003E5UL
829b106467Jason King
830b106467Jason King#define CKM_KEY_WRAP_LYNKS             0x00000400UL
831b106467Jason King#define CKM_KEY_WRAP_SET_OAEP          0x00000401UL
832b106467Jason King
833b106467Jason King#define CKM_CMS_SIG                    0x00000500UL
834b106467Jason King#define CKM_KIP_DERIVE                 0x00000510UL
835b106467Jason King#define CKM_KIP_WRAP                   0x00000511UL
836b106467Jason King#define CKM_KIP_MAC                    0x00000512UL
837b106467Jason King
838b106467Jason King#define CKM_CAMELLIA_KEY_GEN           0x00000550UL
839b106467Jason King#define CKM_CAMELLIA_ECB               0x00000551UL
840b106467Jason King#define CKM_CAMELLIA_CBC               0x00000552UL
841b106467Jason King#define CKM_CAMELLIA_MAC               0x00000553UL
842b106467Jason King#define CKM_CAMELLIA_MAC_GENERAL       0x00000554UL
843b106467Jason King#define CKM_CAMELLIA_CBC_PAD           0x00000555UL
844b106467Jason King#define CKM_CAMELLIA_ECB_ENCRYPT_DATA  0x00000556UL
845b106467Jason King#define CKM_CAMELLIA_CBC_ENCRYPT_DATA  0x00000557UL
846b106467Jason King#define CKM_CAMELLIA_CTR               0x00000558UL
847b106467Jason King
848b106467Jason King#define CKM_ARIA_KEY_GEN               0x00000560UL
849b106467Jason King#define CKM_ARIA_ECB                   0x00000561UL
850b106467Jason King#define CKM_ARIA_CBC                   0x00000562UL
851b106467Jason King#define CKM_ARIA_MAC                   0x00000563UL
852b106467Jason King#define CKM_ARIA_MAC_GENERAL           0x00000564UL
853b106467Jason King#define CKM_ARIA_CBC_PAD               0x00000565UL
854b106467Jason King#define CKM_ARIA_ECB_ENCRYPT_DATA      0x00000566UL
855b106467Jason King#define CKM_ARIA_CBC_ENCRYPT_DATA      0x00000567UL
856b106467Jason King
857b106467Jason King#define CKM_SEED_KEY_GEN               0x00000650UL
858b106467Jason King#define CKM_SEED_ECB                   0x00000651UL
859b106467Jason King#define CKM_SEED_CBC                   0x00000652UL
860b106467Jason King#define CKM_SEED_MAC                   0x00000653UL
861b106467Jason King#define CKM_SEED_MAC_GENERAL           0x00000654UL
862b106467Jason King#define CKM_SEED_CBC_PAD               0x00000655UL
863b106467Jason King#define CKM_SEED_ECB_ENCRYPT_DATA      0x00000656UL
864b106467Jason King#define CKM_SEED_CBC_ENCRYPT_DATA      0x00000657UL
865b106467Jason King
866b106467Jason King#define CKM_SKIPJACK_KEY_GEN           0x00001000UL
867b106467Jason King#define CKM_SKIPJACK_ECB64             0x00001001UL
868b106467Jason King#define CKM_SKIPJACK_CBC64             0x00001002UL
869b106467Jason King#define CKM_SKIPJACK_OFB64             0x00001003UL
870b106467Jason King#define CKM_SKIPJACK_CFB64             0x00001004UL
871b106467Jason King#define CKM_SKIPJACK_CFB32             0x00001005UL
872b106467Jason King#define CKM_SKIPJACK_CFB16             0x00001006UL
873b106467Jason King#define CKM_SKIPJACK_CFB8              0x00001007UL
874b106467Jason King#define CKM_SKIPJACK_WRAP              0x00001008UL
875b106467Jason King#define CKM_SKIPJACK_PRIVATE_WRAP      0x00001009UL
876b106467Jason King#define CKM_SKIPJACK_RELAYX            0x0000100aUL
877b106467Jason King#define CKM_KEA_KEY_PAIR_GEN           0x00001010UL
878b106467Jason King#define CKM_KEA_KEY_DERIVE             0x00001011UL
879b106467Jason King#define CKM_KEA_DERIVE                 0x00001012UL
880b106467Jason King#define CKM_FORTEZZA_TIMESTAMP         0x00001020UL
881b106467Jason King#define CKM_BATON_KEY_GEN              0x00001030UL
882b106467Jason King#define CKM_BATON_ECB128               0x00001031UL
883b106467Jason King#define CKM_BATON_ECB96                0x00001032UL
884b106467Jason King#define CKM_BATON_CBC128               0x00001033UL
885b106467Jason King#define CKM_BATON_COUNTER              0x00001034UL
886b106467Jason King#define CKM_BATON_SHUFFLE              0x00001035UL
887b106467Jason King#define CKM_BATON_WRAP                 0x00001036UL
888b106467Jason King
889b106467Jason King#define CKM_ECDSA_KEY_PAIR_GEN         0x00001040UL /* Deprecated */
890b106467Jason King#define CKM_EC_KEY_PAIR_GEN            0x00001040UL
891b106467Jason King
892b106467Jason King#define CKM_ECDSA                      0x00001041UL
893b106467Jason King#define CKM_ECDSA_SHA1                 0x00001042UL
894b106467Jason King#define CKM_ECDSA_SHA224               0x00001043UL
895b106467Jason King#define CKM_ECDSA_SHA256               0x00001044UL
896b106467Jason King#define CKM_ECDSA_SHA384               0x00001045UL
897b106467Jason King#define CKM_ECDSA_SHA512               0x00001046UL
898b106467Jason King
899b106467Jason King#define CKM_ECDH1_DERIVE               0x00001050UL
900b106467Jason King#define CKM_ECDH1_COFACTOR_DERIVE      0x00001051UL
901b106467Jason King#define CKM_ECMQV_DERIVE               0x00001052UL
902b106467Jason King
903b106467Jason King#define CKM_ECDH_AES_KEY_WRAP          0x00001053UL
904b106467Jason King#define CKM_RSA_AES_KEY_WRAP           0x00001054UL
905b106467Jason King
906b106467Jason King#define CKM_JUNIPER_KEY_GEN            0x00001060UL
907b106467Jason King#define CKM_JUNIPER_ECB128             0x00001061UL
908b106467Jason King#define CKM_JUNIPER_CBC128             0x00001062UL
909b106467Jason King#define CKM_JUNIPER_COUNTER            0x00001063UL
910b106467Jason King#define CKM_JUNIPER_SHUFFLE            0x00001064UL
911b106467Jason King#define CKM_JUNIPER_WRAP               0x00001065UL
912b106467Jason King#define CKM_FASTHASH                   0x00001070UL
913b106467Jason King
914b106467Jason King#define CKM_AES_KEY_GEN                0x00001080UL
915b106467Jason King#define CKM_AES_ECB                    0x00001081UL
916b106467Jason King#define CKM_AES_CBC                    0x00001082UL
917b106467Jason King#define CKM_AES_MAC                    0x00001083UL
918b106467Jason King#define CKM_AES_MAC_GENERAL            0x00001084UL
919b106467Jason King#define CKM_AES_CBC_PAD                0x00001085UL
920b106467Jason King#define CKM_AES_CTR                    0x00001086UL
921b106467Jason King#define CKM_AES_GCM                    0x00001087UL
922b106467Jason King#define CKM_AES_CCM                    0x00001088UL
923b106467Jason King#define CKM_AES_CTS                    0x00001089UL
924b106467Jason King#define CKM_AES_CMAC                   0x0000108AUL
925b106467Jason King#define CKM_AES_CMAC_GENERAL           0x0000108BUL
926b106467Jason King
927b106467Jason King#define CKM_AES_XCBC_MAC               0x0000108CUL
928b106467Jason King#define CKM_AES_XCBC_MAC_96            0x0000108DUL
929b106467Jason King#define CKM_AES_GMAC                   0x0000108EUL
930b106467Jason King
931b106467Jason King#define CKM_BLOWFISH_KEY_GEN           0x00001090UL
932b106467Jason King#define CKM_BLOWFISH_CBC               0x00001091UL
933b106467Jason King#define CKM_TWOFISH_KEY_GEN            0x00001092UL
934b106467Jason King#define CKM_TWOFISH_CBC                0x00001093UL
935b106467Jason King#define CKM_BLOWFISH_CBC_PAD           0x00001094UL
936b106467Jason King#define CKM_TWOFISH_CBC_PAD            0x00001095UL
937b106467Jason King
938b106467Jason King#define CKM_DES_ECB_ENCRYPT_DATA       0x00001100UL
939b106467Jason King#define CKM_DES_CBC_ENCRYPT_DATA       0x00001101UL
940b106467Jason King#define CKM_DES3_ECB_ENCRYPT_DATA      0x00001102UL
941b106467Jason King#define CKM_DES3_CBC_ENCRYPT_DATA      0x00001103UL
942b106467Jason King#define CKM_AES_ECB_ENCRYPT_DATA       0x00001104UL
943b106467Jason King#define CKM_AES_CBC_ENCRYPT_DATA       0x00001105UL
944b106467Jason King
945b106467Jason King#define CKM_GOSTR3410_KEY_PAIR_GEN     0x00001200UL
946b106467Jason King#define CKM_GOSTR3410                  0x00001201UL
947b106467Jason King#define CKM_GOSTR3410_WITH_GOSTR3411   0x00001202UL
948b106467Jason King#define CKM_GOSTR3410_KEY_WRAP         0x00001203UL
949b106467Jason King#define CKM_GOSTR3410_DERIVE           0x00001204UL
950b106467Jason King#define CKM_GOSTR3411                  0x00001210UL
951b106467Jason King#define CKM_GOSTR3411_HMAC             0x00001211UL
952b106467Jason King#define CKM_GOST28147_KEY_GEN          0x00001220UL
953