corePKCS11  V3.0.0
PKCS #11 Cryptoki Library
core_pkcs11_pal.h
Go to the documentation of this file.
1 /*
2  * corePKCS11 V3.0.0
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25 
26 #ifndef CORE_PKCS11_PAL
27 #define CORE_PKCS11_PAL
28 
34 /*-----------------------------------------------------------*/
35 /*------------ Port Specific File Access API ----------------*/
36 /*--------- See core_pkcs11_pal.c for definitions ------------*/
37 /*-----------------------------------------------------------*/
38 
39 /*------------------------ PKCS #11 PAL functions -------------------------*/
40 
50 /* @[declare_pkcs11_pal_initialize] */
51 CK_RV PKCS11_PAL_Initialize( void );
52 /* @[declare_pkcs11_pal_initialize] */
53 
66 /* @[declare_pkcs11_pal_saveobject] */
67 CK_OBJECT_HANDLE PKCS11_PAL_SaveObject( CK_ATTRIBUTE_PTR pxLabel,
68  CK_BYTE_PTR pucData,
69  CK_ULONG ulDataSize );
70 /* @[declare_pkcs11_pal_saveobject] */
71 
77 /* @[declare_pkcs11_pal_destroyobject] */
78 CK_RV PKCS11_PAL_DestroyObject( CK_OBJECT_HANDLE xHandle );
79 /* @[declare_pkcs11_pal_destroyobject] */
80 
94 /* @[declare_pkcs11_pal_findobject] */
95 CK_OBJECT_HANDLE PKCS11_PAL_FindObject( CK_BYTE_PTR pxLabel,
96  CK_ULONG usLength );
97 /* @[declare_pkcs11_pal_findobject] */
98 
99 
123 /* @[declare_pkcs11_pal_getobjectvalue] */
124 CK_RV PKCS11_PAL_GetObjectValue( CK_OBJECT_HANDLE xHandle,
125  CK_BYTE_PTR * ppucData,
126  CK_ULONG_PTR pulDataSize,
127  CK_BBOOL * pIsPrivate );
128 /* @[declare_pkcs11_pal_getobjectvalue] */
129 
138 /* @[declare_pkcs11_pal_getobjectvaluecleanup] */
139 void PKCS11_PAL_GetObjectValueCleanup( CK_BYTE_PTR pucData,
140  CK_ULONG ulDataSize );
141 /* @[declare_pkcs11_pal_getobjectvaluecleanup] */
142 
143 #endif /* CORE_PKCS11_PAL include guard. */
PKCS11_PAL_Initialize
CK_RV PKCS11_PAL_Initialize(void)
Initializes the PKCS #11 PAL.
PKCS11_PAL_GetObjectValueCleanup
void PKCS11_PAL_GetObjectValueCleanup(CK_BYTE_PTR pucData, CK_ULONG ulDataSize)
Cleanup after PKCS11_GetObjectValue().
PKCS11_PAL_GetObjectValue
CK_RV PKCS11_PAL_GetObjectValue(CK_OBJECT_HANDLE xHandle, CK_BYTE_PTR *ppucData, CK_ULONG_PTR pulDataSize, CK_BBOOL *pIsPrivate)
Gets the value of an object in storage, by handle.
PKCS11_PAL_DestroyObject
CK_RV PKCS11_PAL_DestroyObject(CK_OBJECT_HANDLE xHandle)
Delete an object from NVM.
PKCS11_PAL_FindObject
CK_OBJECT_HANDLE PKCS11_PAL_FindObject(CK_BYTE_PTR pxLabel, CK_ULONG usLength)
Translates a PKCS #11 label into an object handle.
PKCS11_PAL_SaveObject
CK_OBJECT_HANDLE PKCS11_PAL_SaveObject(CK_ATTRIBUTE_PTR pxLabel, CK_BYTE_PTR pucData, CK_ULONG ulDataSize)
Saves an object in non-volatile storage.