Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pkcs11p6r.h
Go to the documentation of this file.
1 
11 #ifndef _PKCS11P6R_H_
12 #define _PKCS11P6R_H_ 1
13 
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /* [A] The following P6R vendor initialization flags are defined: */
24 #define CKF_P6R_LOGGINGON 0x80000000UL
25 
26 
27 /* [B] The following P6R vendor attribute types are defined: */
28 
29 /* CKA_P6R_GROUP
30  Purpose: to allow PKCS 11 objects to be placed into collections
31  Data Type: RFC 2279 string
32  MUST be specified when object is created with C_CreateObject.
33  MUST be specified when object is created with C_GenerateKey or C_GenerateKeyPair.
34  */
35 #define CKA_P6R_GROUP 0x80001000UL
36 
37 /* CKA_P6R_EXT1
38  Purpose: to allow a user to associate whatever data they want to an object
39  Data Type: Byte Array
40  Can be created and modified at any time
41  */
42 #define CKA_P6R_EXT1 0x80001002UL
43 
44 
45 /* [C] The following P6R vendor types are defined: */
46 typedef struct {
49 
50 typedef struct {
51  CK_UTF8CHAR_PTR pFQDN; // -> KMIP server host name
52  CK_ULONG ulFQDNLen; // -> length in bytes of the server host name
53  CK_ULONG port; // -> KMIP server port
54  CK_ULONG useFlags; // -> KMIP client behavior flags
55  CK_VOID_PTR pCredentials; // -> actually a P6KMIP_CREDENTIAL*, if the KMIP client certificate is not enough to authenticate the KMIP user //
56  CK_UTF8CHAR_PTR pDefaultGroup; // -> KMIP default group
57  CK_ULONG ulGroupLen; // -> length in bytes of the group name
58  CK_UTF8CHAR_PTR pClientCert; // -> path to KMIP client certificate PEM file
59  CK_ULONG ulClientCertLen; // -> length in bytes pointed to by pClientCert
60  CK_UTF8CHAR_PTR pClientPrvKey; // -> path to KMIP client private key PEM file
61  CK_ULONG ulClientPrvKeyLen; // -> length in bytes pointed to by pClientPrvKey
62  CK_UTF8CHAR_PTR pRootCert; // -> path to KMIP server's root certificate file
63  CK_ULONG ulRootCertLen; // -> length in bytes pointed to by pRootCert
65 
66 /* P6R_VENDOR_SLOT_INFO
67  *
68  * type - indicates which union element is used {1..}, 0 means no value set
69  */
70 typedef struct {
72  union {
73  P6R_SLOT_INFO p6r_slot; // -> entry type == 1
74  } slot;
76 
77 /* P6R_VENDOR_TOKEN_INFO
78  *
79  * type - indicates which union element is used {1..}, 0 means no value set
80  */
81 typedef struct {
83  union {
84  P6R_KMIP_TOKEN_INFO p6r_kmip; // -> entry type == 1
85  } token;
87 
88 
89 /* [D] The following P6R vendor methods are defined: */
97 extern CK_DECLARE_FUNCTION(CK_RV, P6R_GetSlotList)
98 (
99  CK_ULONG slotId, /* input: P6R slot number for 3rd party token */
100  CK_BBOOL tokenPresent, /* input: same as C_GetSlotList */
101  CK_SLOT_ID_PTR pSlotList, /* output: same as C_GetSlotList */
102  CK_ULONG_PTR pulCount /* input/output: same as C_GetSlotList */
103 );
104 
105 
106 /* P6R_DestroyToken frees all contents in the token and disables its containing slot */
121 extern CK_DECLARE_FUNCTION(CK_RV, P6R_DestroyToken)
122 (
123  CK_SLOT_ID slotID, /* input: ID of the token's slot */
124  CK_UTF8CHAR_PTR pPin, /* input: the SO's initial PIN */
125  CK_ULONG ulPinLen /* input: length in bytes of the PIN */
126 );
127 
128 
129 
141 extern CK_DECLARE_FUNCTION(CK_RV, P6R_CreateSlot)
142 (
143  CK_SLOT_INFO_PTR pInfo, /* input: standard PKCS11 properties of the slot to be created */
144  P6R_VENDOR_SLOT_INFO* pExtension, /* input: extension properties for a vendor slot to be created */
145  CK_SLOT_ID_PTR pSlotId /* output: the identifier value assigned to the new slot */
146 );
147 
148 
161 extern CK_DECLARE_FUNCTION(CK_RV, P6R_CreateToken)
162 (
163  CK_SLOT_ID slotID, /* input: the identifier value returned by a call to P6R_CreateSlot() */
164  CK_TOKEN_INFO_PTR pTokenInfo, /* input: standard PKCS11 properties of the token to be created */
165  P6R_VENDOR_TOKEN_INFO* pExtension /* input: extension properties for a vendor token to be created */
166 );
167 
168 
180 extern CK_DECLARE_FUNCTION(CK_RV, P6R_GetKMIPClient)
181 (
182  CK_SESSION_HANDLE hSession, /* input: the identifier value returned by a call to C_OpenSession() */
183  CK_VOID_PTR_PTR pKMIP /* output: p6IKMIPClient2 pointer to an active KMIP Client object for an open session for a KMIP token */
184 );
185 
186 
187 // [E] Supported 3rd party token extensions defined
188 /* Vendor defined user login types
189  * Purpose:
190  * login type for Utimaco CryptoServer user (used for Admin login)
191  */
192 #define CKU_CS_GENERIC 0x83
193 
194 
200 extern CK_DECLARE_FUNCTION(CK_RV, Thales_C_LoginBegin)
201 (
202  CK_SESSION_HANDLE hSession, /* the session's handle */
203  CK_USER_TYPE userType, /* the user type */
204  CK_ULONG_PTR pulK, /* cards required to load logical token*/
205  CK_ULONG_PTR pulN /* Number of cards in set */
206 );
207 
208 extern CK_DECLARE_FUNCTION(CK_RV, Thales_C_LoginNext)
209 (
210  CK_SESSION_HANDLE hSession, /* the session's handle */
211  CK_USER_TYPE userType, /* the user type*/
212  CK_CHAR_PTR pPin, /* the user's PIN*/
213  CK_ULONG ulPinLen, /* the length of the PIN */
214  CK_ULONG_PTR pulSharesLeft /* Number of shares still needed */
215 );
216 
217 extern CK_DECLARE_FUNCTION(CK_RV, Thales_C_LoginEnd)
218 (
219  CK_SESSION_HANDLE hSession, /* the session's handle */
220  CK_USER_TYPE userType /* the user type*/
221 );
222 
223 
231 extern CK_DECLARE_FUNCTION(CK_RV, Futurex_C_FX_GetLogFile)( CK_SLOT_ID P6RslotId, CK_RV* pRV, CK_CHAR_PTR szLogFile, CK_LONG* piLen );
232 
233 extern CK_DECLARE_FUNCTION(CK_LONG, Futurex_C_FX_GetLogMode)( CK_SLOT_ID P6RslotId );
234 
235 extern CK_DECLARE_FUNCTION(CK_LONG, Futurex_C_FX_GetKeyClarityMode)( CK_SLOT_ID P6RslotId );
236 
237 extern CK_DECLARE_FUNCTION(void, Futurex_C_FX_MemFree)( CK_SLOT_ID P6RslotId, CK_VOID_PTR pvMem );
238 
239 extern CK_DECLARE_FUNCTION(CK_CHAR_PTR, Futurex_C_FX_HexEncode)( CK_SLOT_ID P6RslotId, const CK_CHAR_PTR pauclnput, CK_LONG iLen );
240 
241 extern CK_DECLARE_FUNCTION(CK_CHAR_PTR, Futurex_C_FX_HexDecode)( CK_SLOT_ID P6RslotId, CK_CHAR_PTR pszInput );
242 
243 extern CK_DECLARE_FUNCTION(void, Futurex_C_FX_FreeTemplate)( CK_SLOT_ID P6RslotId, CK_ATTRIBUTE_PTR ptTemplate, CK_ULONG ulNumAttributes );
244 
245 extern CK_DECLARE_FUNCTION(void, Futurex_C_FX_SleepMS)( CK_SLOT_ID P6RslotId, CK_ULONG ulSleepTime );
246 
247 extern CK_DECLARE_FUNCTION(CK_ULONG, Futurex_C_FX_ThreadID)( CK_SLOT_ID P6RslotId );
248 
249 extern CK_DECLARE_FUNCTION(CK_RV, Futurex_C_FX_ReloadTokenInfo)( CK_SLOT_ID P6RslotId, CK_SLOT_ID ulSlotID );
250 
251 extern CK_DECLARE_FUNCTION(CK_CHAR_PTR, Futurex_C_FX_GetClassString)( CK_SLOT_ID P6RslotId, CK_OBJECT_CLASS ocClass );
252 
253 extern CK_DECLARE_FUNCTION(CK_CHAR_PTR, Futurex_C_FX_GetKeyTypeString)( CK_SLOT_ID P6RslotId, CK_KEY_TYPE ktKeyType );
254 
255 extern CK_DECLARE_FUNCTION(CK_CHAR_PTR, Futurex_C_FX_GetErrorString)( CK_SLOT_ID P6RslotId, CK_RV ckrv );
256 
257 extern CK_DECLARE_FUNCTION(CK_CHAR_PTR, Futurex_C_FX_GetMechanismString)( CK_SLOT_ID P6RslotId, CK_MECHANISM_TYPE ulMech );
258 
259 extern CK_DECLARE_FUNCTION(CK_RV, Futurex_C_FX_SendMessageSynch)
260 (
261  CK_SESSION_HANDLE hSession,
266 );
267 
268 extern CK_DECLARE_FUNCTION(CK_SLOT_ID, Futurex_C_FX_GetObjectSlot)( CK_SLOT_ID P6RslotId, CK_OBJECT_HANDLE hObject );
269 
270 extern CK_DECLARE_FUNCTION(CK_VOID_PTR, Futurex_C_FX_GenericCreateMutex)( CK_SLOT_ID P6RslotId );
271 
272 extern CK_DECLARE_FUNCTION(CK_BBOOL, Futurex_C_FX_GenericLockMutex)( CK_SLOT_ID P6RslotId, CK_VOID_PTR pMutex );
273 
274 extern CK_DECLARE_FUNCTION(CK_BBOOL, Futurex_C_FX_GenericUnlockMutex)( CK_SLOT_ID P6RslotId, CK_VOID_PTR pMutex );
275 
276 extern CK_DECLARE_FUNCTION(CK_BBOOL, Futurex_C_FX_GenericDestroyMutex)( CK_SLOT_ID P6RslotId, CK_VOID_PTR pMutex );
277 
278 
279 #ifdef __cplusplus
280 }
281 #endif
282 
283 #endif
CK_ULONG ulClientCertLen
Definition: pkcs11p6r.h:59
CK_RV * pRV
Definition: pkcs11p6r.h:231
CK_ULONG CK_KEY_TYPE
Definition: pkcs11t.h:332
CK_SLOT_ID ulSlotID
Definition: pkcs11p6r.h:249
CK_TOKEN_INFO_PTR pTokenInfo
Definition: pkcs11p6r.h:164
CK_USER_TYPE CK_ULONG_PTR CK_ULONG_PTR pulN
Definition: pkcs11p6r.h:203
CK_ULONG ulFQDNLen
Definition: pkcs11p6r.h:52
CK_ULONG CK_OBJECT_HANDLE
Definition: pkcs11t.h:294
CK_USER_TYPE CK_CHAR_PTR CK_ULONG CK_ULONG_PTR pulSharesLeft
Definition: pkcs11p6r.h:211
CK_ULONG ulClientPrvKeyLen
Definition: pkcs11p6r.h:61
CK_VOID_PTR pMutex
Definition: pkcs11p6r.h:272
CK_RV ckrv
Definition: pkcs11p6r.h:255
CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR
Definition: pkcs11t.h:65
CK_ATTRIBUTE_PTR CK_ULONG ulNumAttributes
Definition: pkcs11p6r.h:243
CK_ULONG ulRootCertLen
Definition: pkcs11p6r.h:63
CK_VOID_PTR_PTR pKMIP
Definition: pkcs11p6r.h:184
CK_ULONG CK_MECHANISM_TYPE
Definition: pkcs11t.h:579
CK_VOID_PTR pCredentials
Definition: pkcs11p6r.h:55
CK_RV CK_CHAR_PTR szLogFile
Definition: pkcs11p6r.h:231
CK_BBOOL tokenPresent
Definition: pkcs11p6r.h:100
CK_ATTRIBUTE_PTR ptTemplate
Definition: pkcs11p6r.h:243
unsigned long int CK_ULONG
Definition: pkcs11t.h:44
CK_UTF8CHAR_PTR CK_ULONG ulPinLen
Definition: pkcs11p6r.h:124
CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR
Definition: pkcs11t.h:246
const CK_CHAR_PTR CK_LONG iLen
Definition: pkcs11p6r.h:239
void CK_PTR CK_VOID_PTR
Definition: pkcs11t.h:62
P6R_KMIP_TOKEN_INFO p6r_kmip
Definition: pkcs11p6r.h:84
CK_UTF8CHAR_PTR pRootCert
Definition: pkcs11p6r.h:62
CK_ULONG CK_SLOT_ID
Definition: pkcs11t.h:100
const CK_CHAR_PTR binMessage
Definition: pkcs11p6r.h:262
CK_ULONG useFlags
Definition: pkcs11p6r.h:54
CK_USER_TYPE CK_ULONG_PTR pulK
Definition: pkcs11p6r.h:203
CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR
Definition: pkcs11t.h:102
const CK_CHAR_PTR CK_ULONG ulMessageLen
Definition: pkcs11p6r.h:262
CK_ULONG none
Definition: pkcs11p6r.h:47
#define CK_DECLARE_FUNCTION(returnType, name)
Definition: pkcs11.h:115
CK_VOID_PTR pvMem
Definition: pkcs11p6r.h:237
const CK_CHAR_PTR pauclnput
Definition: pkcs11p6r.h:239
CK_CHAR_PTR pszInput
Definition: pkcs11p6r.h:241
CK_RV CK_CHAR_PTR CK_LONG * piLen
Definition: pkcs11p6r.h:231
CK_ULONG CK_OBJECT_CLASS
Definition: pkcs11t.h:303
it may not contain all the symbols used by this software If you run into undefined symbol please let us know and we can provide you a build that will be compatible with your specific when KMIP messages are in XML or JSON no pretty printing is done in order to capture exactly what is sent received from the server On any error other than CKR_BUFFER_TOO_SMALL functions C_Encrypt and C_Decrypt are supposed to terminate active encryption decryption operations This was not being done properly but has now been fixed p6ISymmetricCrypto::encryptEnd and p6ISymmetricCrypto::decryptEnd did not return zero for data length returned when there is no data to be returned Caller would believe that there was more encrypted decrypted data for a final block when there was none Now these functions properly return a zero data length returned when there is no data for the caller Proper handling of the CKA_ALWAYS_AUTHENTICATE attribute was not implemented Fixed race condition in the use of a semaphore that protects calls to C_Initialize and C_Finalize Created native linux installer for only versions of Linux operating systems and DestroyMutex calls on Thales and HPE HSMs Added new component p6ISemaphore which implements a platform independent named semaphore Minimum glibc version is now Integrated the Utimaco HSM PKCS under the P6R PKCS Utimaco HSM can be mapped into a P6R PKCS Utimaco Token The P6R Utimaco Token also converts Utimaco HSM vendor extension mechanism codes into and out of PKCS codes where ever possible Added the following PKCS11 API functions to P6R s software token
Definition: readme.txt:161
CK_ULONG ulGroupLen
Definition: pkcs11p6r.h:57
CK_UTF8CHAR_PTR pClientPrvKey
Definition: pkcs11p6r.h:60
CK_KEY_TYPE ktKeyType
Definition: pkcs11p6r.h:253
CK_CHAR CK_PTR CK_CHAR_PTR
Definition: pkcs11t.h:59
CK_BBOOL CK_SLOT_ID_PTR CK_ULONG_PTR pulCount
Definition: pkcs11p6r.h:100
CK_OBJECT_HANDLE hObject
Definition: pkcs11p6r.h:268
CK_ULONG ulSleepTime
Definition: pkcs11p6r.h:245
P6R_SLOT_INFO p6r_slot
Definition: pkcs11p6r.h:73
CK_ULONG CK_SESSION_HANDLE
Definition: pkcs11t.h:252
CK_BBOOL CK_SLOT_ID_PTR pSlotList
Definition: pkcs11p6r.h:100
CK_BYTE CK_BBOOL
Definition: pkcs11t.h:41
CK_UTF8CHAR_PTR pDefaultGroup
Definition: pkcs11p6r.h:56
const CK_CHAR_PTR CK_ULONG CK_CHAR_PTR binResponse
Definition: pkcs11p6r.h:262
CK_UTF8CHAR_PTR pFQDN
Definition: pkcs11p6r.h:51
long int CK_LONG
Definition: pkcs11t.h:47
CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR
Definition: pkcs11t.h:122
CK_OBJECT_CLASS ocClass
Definition: pkcs11p6r.h:251
CK_MECHANISM_TYPE ulMech
Definition: pkcs11p6r.h:257
const CK_CHAR_PTR CK_ULONG CK_CHAR_PTR CK_ULONG * pulResponseLen
Definition: pkcs11p6r.h:262
P6R_VENDOR_SLOT_INFO * pExtension
Definition: pkcs11p6r.h:144
CK_ULONG CK_PTR CK_ULONG_PTR
Definition: pkcs11t.h:61
CK_USER_TYPE userType
Definition: pkcs11p6r.h:203
CK_ULONG CK_USER_TYPE
Definition: pkcs11t.h:258
CK_UTF8CHAR_PTR pClientCert
Definition: pkcs11p6r.h:58
CK_UTF8CHAR_PTR pPin
Definition: pkcs11p6r.h:124
P6R_VENDOR_SLOT_INFO CK_SLOT_ID_PTR pSlotId
Definition: pkcs11p6r.h:144
CK_ULONG CK_RV
Definition: pkcs11t.h:1032
CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR
Definition: pkcs11t.h:566
CK_UTF8CHAR CK_PTR CK_UTF8CHAR_PTR
Definition: pkcs11t.h:60