Path: blob/master/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.h
41149 views
/*1* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.2*/34/*5* reserved comment block6* DO NOT REMOVE OR ALTER!7*/8/* Copyright (c) 2002 Graz University of Technology. All rights reserved.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions are met:12*13* 1. Redistributions of source code must retain the above copyright notice,14* this list of conditions and the following disclaimer.15*16* 2. Redistributions in binary form must reproduce the above copyright notice,17* this list of conditions and the following disclaimer in the documentation18* and/or other materials provided with the distribution.19*20* 3. The end-user documentation included with the redistribution, if any, must21* include the following acknowledgment:22*23* "This product includes software developed by IAIK of Graz University of24* Technology."25*26* Alternately, this acknowledgment may appear in the software itself, if27* and wherever such third-party acknowledgments normally appear.28*29* 4. The names "Graz University of Technology" and "IAIK of Graz University of30* Technology" must not be used to endorse or promote products derived from31* this software without prior written permission.32*33* 5. Products derived from this software may not be called34* "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior35* written permission of Graz University of Technology.36*37* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED38* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED39* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR40* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE41* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,42* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,43* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,44* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON45* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,46* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY47* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE48* POSSIBILITY OF SUCH DAMAGE.49*/5051/*52* platoform.h53* 10.12.200154*55* declaration of all platform dependent functions used by pkcs11wrapper.c56*57* @author Karl Scheibelhofer <[email protected]>58*/5960/* defines for WIN32 platform *************************************************/6162#include <windows.h>6364/* statement according to PKCS11 docu */65#pragma pack(push, cryptoki, 1)6667/* definitions according to PKCS#11 docu for Win32 environment */68#define CK_PTR *69#define CK_DEFINE_FUNCTION(returnType, name) returnType __declspec(dllexport) name70#define CK_DECLARE_FUNCTION(returnType, name) returnType __declspec(dllimport) name71#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType __declspec(dllimport) (* name)72#define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)73#ifndef NULL_PTR74#define NULL_PTR 075#endif /* NULL_PTR */7677/* to avoid clash with Win32 #define */78#ifdef CreateMutex79#undef CreateMutex80#endif /* CreateMutex */8182#include "pkcs11.h"83#include "pkcs11gcm2.h"8485/* statement according to PKCS11 docu */86#pragma pack(pop, cryptoki)8788#include "jni.h"8990/* A data structure to hold required information about a PKCS#11 module. */91struct ModuleData {9293HINSTANCE hModule;9495/* The pointer to the PKCS#11 functions of this module. */96CK_FUNCTION_LIST_PTR ckFunctionListPtr;9798/* Reference to the object to use for mutex handling. NULL, if not used. */99jobject applicationMutexHandler;100101};102typedef struct ModuleData ModuleData;103104105