corePKCS11 v3.1.0
PKCS #11 Cryptoki Library
core_pkcs11_pal.h
Go to the documentation of this file.
1/*
2 * corePKCS11 v3.1.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/* *INDENT-OFF* */
35#ifdef __cplusplus
36 extern "C" {
37#endif
38/* *INDENT-ON* */
39
40/*-----------------------------------------------------------*/
41/*------------ Port Specific File Access API ----------------*/
42/*--------- See core_pkcs11_pal.c for definitions ------------*/
43/*-----------------------------------------------------------*/
44
45/*------------------------ PKCS #11 PAL functions -------------------------*/
46
56/* @[declare_pkcs11_pal_initialize] */
58/* @[declare_pkcs11_pal_initialize] */
59
72/* @[declare_pkcs11_pal_saveobject] */
73CK_OBJECT_HANDLE PKCS11_PAL_SaveObject( CK_ATTRIBUTE_PTR pxLabel,
74 CK_BYTE_PTR pucData,
75 CK_ULONG ulDataSize );
76/* @[declare_pkcs11_pal_saveobject] */
77
83/* @[declare_pkcs11_pal_destroyobject] */
84CK_RV PKCS11_PAL_DestroyObject( CK_OBJECT_HANDLE xHandle );
85/* @[declare_pkcs11_pal_destroyobject] */
86
100/* @[declare_pkcs11_pal_findobject] */
101CK_OBJECT_HANDLE PKCS11_PAL_FindObject( CK_BYTE_PTR pxLabel,
102 CK_ULONG usLength );
103/* @[declare_pkcs11_pal_findobject] */
104
105
129/* @[declare_pkcs11_pal_getobjectvalue] */
130CK_RV PKCS11_PAL_GetObjectValue( CK_OBJECT_HANDLE xHandle,
131 CK_BYTE_PTR * ppucData,
132 CK_ULONG_PTR pulDataSize,
133 CK_BBOOL * pIsPrivate );
134/* @[declare_pkcs11_pal_getobjectvalue] */
135
144/* @[declare_pkcs11_pal_getobjectvaluecleanup] */
145void PKCS11_PAL_GetObjectValueCleanup( CK_BYTE_PTR pucData,
146 CK_ULONG ulDataSize );
147/* @[declare_pkcs11_pal_getobjectvaluecleanup] */
148
149/* *INDENT-OFF* */
150#ifdef __cplusplus
151 }
152#endif
153/* *INDENT-ON* */
154
155#endif /* CORE_PKCS11_PAL include guard. */
CK_RV PKCS11_PAL_DestroyObject(CK_OBJECT_HANDLE xHandle)
Delete an object from NVM.
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.
void PKCS11_PAL_GetObjectValueCleanup(CK_BYTE_PTR pucData, CK_ULONG ulDataSize)
Cleanup after PKCS11_GetObjectValue().
CK_OBJECT_HANDLE PKCS11_PAL_FindObject(CK_BYTE_PTR pxLabel, CK_ULONG usLength)
Translates a PKCS #11 label into an object handle.
CK_OBJECT_HANDLE PKCS11_PAL_SaveObject(CK_ATTRIBUTE_PTR pxLabel, CK_BYTE_PTR pucData, CK_ULONG ulDataSize)
Saves an object in non-volatile storage.
CK_RV PKCS11_PAL_Initialize(void)
Initializes the PKCS #11 PAL.