From e7d5c6b4b04bb34172788fba5532b89e70a1f5ac Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 1 Dec 2008 20:38:32 +0000 Subject: Split headers for C file into own header. --- ckcapi-token.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 ckcapi-token.h (limited to 'ckcapi-token.h') diff --git a/ckcapi-token.h b/ckcapi-token.h new file mode 100644 index 0000000..6927241 --- /dev/null +++ b/ckcapi-token.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2007 Stef Walter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef CKCAPI_TOKEN_H +#define CKCAPI_TOKEN_H + +#include "ckcapi.h" + +#define CKCAPI_SLOT_CA 0x00000001 +#define CKCAPI_SLOT_TRUSTED 0x00000002 + +/* Register a new object, a handle will be assigned to obj->id */ +CK_RV ckcapi_token_register_object (CK_SLOT_ID slot, CkCapiObject* obj); + +/* Lookup an object for a given object handle */ +CkCapiObject* ckcapi_token_lookup_object (CK_SLOT_ID slot, CK_OBJECT_HANDLE obj); + +/* Clear all objects for all tokens. Only done when finalizing */ +void ckcapi_token_cleanup_all (void); + +/* Get the number of the maximum object handle currently in memory */ +CK_OBJECT_HANDLE ckcapi_token_get_max_handle (void); + +unsigned int ckcapi_token_get_count (void); + +CK_SLOT_ID ckcapi_token_get_slot_id (unsigned int index); + +CK_BBOOL ckcapi_token_is_valid (CK_SLOT_ID slot); + +const char* ckcapi_token_get_display_name (CK_SLOT_ID slot); + +const char* ckcapi_token_get_store_name (CK_SLOT_ID slot); + +CK_ULONG ckcapi_token_get_flags (CK_SLOT_ID slot); + +#endif /* CKCAPI_TOKEN_H */ -- cgit v1.2.3