corePKCS11 v3.4.0
PKCS #11 Cryptoki Library
core_pkcs11_pal.h
Go to the documentation of this file.
1/*
2 * corePKCS11 v3.4.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
23#ifndef CORE_PKCS11_PAL
24#define CORE_PKCS11_PAL
25
31/* *INDENT-OFF* */
32#ifdef __cplusplus
33 extern "C" {
34#endif
35/* *INDENT-ON* */
36
37/*-----------------------------------------------------------*/
38/*------------ Port Specific File Access API ----------------*/
39/*--------- See core_pkcs11_pal.c for definitions ------------*/
40/*-----------------------------------------------------------*/
41
42/*------------------------ PKCS #11 PAL functions -------------------------*/
43
53/* @[declare_pkcs11_pal_initialize] */
55/* @[declare_pkcs11_pal_initialize] */
56
69/* @[declare_pkcs11_pal_saveobject] */
70CK_OBJECT_HANDLE PKCS11_PAL_SaveObject( CK_ATTRIBUTE_PTR pxLabel,
71 CK_BYTE_PTR pucData,
72 CK_ULONG ulDataSize );
73/* @[declare_pkcs11_pal_saveobject] */
74
80/* @[declare_pkcs11_pal_destroyobject] */
81CK_RV PKCS11_PAL_DestroyObject( CK_OBJECT_HANDLE xHandle );
82/* @[declare_pkcs11_pal_destroyobject] */
83
97/* @[declare_pkcs11_pal_findobject] */
98CK_OBJECT_HANDLE PKCS11_PAL_FindObject( CK_BYTE_PTR pxLabel,
99 CK_ULONG usLength );
100/* @[declare_pkcs11_pal_findobject] */
101
102
126/* @[declare_pkcs11_pal_getobjectvalue] */
127CK_RV PKCS11_PAL_GetObjectValue( CK_OBJECT_HANDLE xHandle,
128 CK_BYTE_PTR * ppucData,
129 CK_ULONG_PTR pulDataSize,
130 CK_BBOOL * pIsPrivate );
131/* @[declare_pkcs11_pal_getobjectvalue] */
132
141/* @[declare_pkcs11_pal_getobjectvaluecleanup] */
142void PKCS11_PAL_GetObjectValueCleanup( CK_BYTE_PTR pucData,
143 CK_ULONG ulDataSize );
144/* @[declare_pkcs11_pal_getobjectvaluecleanup] */
145
146/* *INDENT-OFF* */
147#ifdef __cplusplus
148 }
149#endif
150/* *INDENT-ON* */
151
152#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.