corePKCS11 v3.5.0
PKCS #11 Cryptoki Library
core_pkcs11_pal.h
Go to the documentation of this file.
1/*
2 * corePKCS11 v3.5.0
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef CORE_PKCS11_PAL
26#define CORE_PKCS11_PAL
27
33/* *INDENT-OFF* */
34#ifdef __cplusplus
35 extern "C" {
36#endif
37/* *INDENT-ON* */
38
39/*-----------------------------------------------------------*/
40/*------------ Port Specific File Access API ----------------*/
41/*--------- See core_pkcs11_pal.c for definitions ------------*/
42/*-----------------------------------------------------------*/
43
44/*------------------------ PKCS #11 PAL functions -------------------------*/
45
55/* @[declare_pkcs11_pal_initialize] */
57/* @[declare_pkcs11_pal_initialize] */
58
71/* @[declare_pkcs11_pal_saveobject] */
72CK_OBJECT_HANDLE PKCS11_PAL_SaveObject( CK_ATTRIBUTE_PTR pxLabel,
73 CK_BYTE_PTR pucData,
74 CK_ULONG ulDataSize );
75/* @[declare_pkcs11_pal_saveobject] */
76
82/* @[declare_pkcs11_pal_destroyobject] */
83CK_RV PKCS11_PAL_DestroyObject( CK_OBJECT_HANDLE xHandle );
84/* @[declare_pkcs11_pal_destroyobject] */
85
99/* @[declare_pkcs11_pal_findobject] */
100CK_OBJECT_HANDLE PKCS11_PAL_FindObject( CK_BYTE_PTR pxLabel,
101 CK_ULONG usLength );
102/* @[declare_pkcs11_pal_findobject] */
103
104
128/* @[declare_pkcs11_pal_getobjectvalue] */
129CK_RV PKCS11_PAL_GetObjectValue( CK_OBJECT_HANDLE xHandle,
130 CK_BYTE_PTR * ppucData,
131 CK_ULONG_PTR pulDataSize,
132 CK_BBOOL * pIsPrivate );
133/* @[declare_pkcs11_pal_getobjectvalue] */
134
143/* @[declare_pkcs11_pal_getobjectvaluecleanup] */
144void PKCS11_PAL_GetObjectValueCleanup( CK_BYTE_PTR pucData,
145 CK_ULONG ulDataSize );
146/* @[declare_pkcs11_pal_getobjectvaluecleanup] */
147
148/* *INDENT-OFF* */
149#ifdef __cplusplus
150 }
151#endif
152/* *INDENT-ON* */
153
154#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.