1 /*
2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3  */
4 
5 /*
6  * reserved comment block
7  * DO NOT REMOVE OR ALTER!
8  */
9 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
10  *
11  * Redistribution and use in  source and binary forms, with or without
12  * modification, are permitted  provided that the following conditions are met:
13  *
14  * 1. Redistributions of  source code must retain the above copyright notice,
15  *    this list of conditions and the following disclaimer.
16  *
17  * 2. Redistributions in  binary form must reproduce the above copyright notice,
18  *    this list of conditions and the following disclaimer in the documentation
19  *    and/or other materials provided with the distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if any, must
22  *    include the following acknowledgment:
23  *
24  *    "This product includes software developed by IAIK of Graz University of
25  *     Technology."
26  *
27  *    Alternately, this acknowledgment may appear in the software itself, if
28  *    and wherever such third-party acknowledgments normally appear.
29  *
30  * 4. The names "Graz University of Technology" and "IAIK of Graz University of
31  *    Technology" must not be used to endorse or promote products derived from
32  *    this software without prior written permission.
33  *
34  * 5. Products derived from this software may not be called
35  *    "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
36  *    written permission of Graz University of Technology.
37  *
38  *  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
39  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
40  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
42  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
43  *  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
45  *  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
46  *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49  *  POSSIBILITY  OF SUCH DAMAGE.
50  */
51 
52 /*
53  * pkcs11wrapper.h
54  * 18.05.2001
55  *
56  * declaration of all functions used by pkcs11wrapper.c
57  *
58  * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
59  */
60 
61 /* defines for UNIX platforms *************************************************/
62 
63 #ifndef _P11_MD_H
64 #define _P11_MD_H 1
65 
66 #define CK_PTR *
67 #define CK_DEFINE_FUNCTION(returnType, name) returnType name
68 #define CK_DECLARE_FUNCTION(returnType, name) returnType name
69 #define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType (* name)
70 #define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)
71 #ifndef NULL_PTR
72 #define NULL_PTR 0
73 #endif
74 
75 #include "pkcs11.h"
76 #include "pkcs11gcm2.h"
77 
78 #include "jni.h"
79 
80 /* A data structure to hold required information about a PKCS#11 module. */
81 struct ModuleData {
82 
83     /* the module (DLL or shared library) handle */
84     void *hModule;
85 
86     /* The pointer to the PKCS#11 functions of this module. */
87     CK_FUNCTION_LIST_PTR ckFunctionListPtr;
88 
89     /* Reference to the object to use for mutex handling. NULL, if not used. */
90     jobject applicationMutexHandler;
91 
92 };
93 typedef struct ModuleData ModuleData;
94 
95 #endif  /* _P11_MD_H */
96