Annotation of embedaddon/strongswan/src/libstrongswan/plugins/pkcs11/pkcs11_manager.h, revision 1.1

1.1     ! misho       1: /*
        !             2:  * Copyright (C) 2010 Martin Willi
        !             3:  * Copyright (C) 2010 revosec AG
        !             4:  *
        !             5:  * This program is free software; you can redistribute it and/or modify it
        !             6:  * under the terms of the GNU General Public License as published by the
        !             7:  * Free Software Foundation; either version 2 of the License, or (at your
        !             8:  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
        !             9:  *
        !            10:  * This program is distributed in the hope that it will be useful, but
        !            11:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
        !            12:  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        !            13:  * for more details.
        !            14:  */
        !            15: 
        !            16: /**
        !            17:  * @defgroup pkcs11_manager pkcs11_manager
        !            18:  * @{ @ingroup pkcs11
        !            19:  */
        !            20: 
        !            21: #ifndef PKCS11_MANAGER_H_
        !            22: #define PKCS11_MANAGER_H_
        !            23: 
        !            24: typedef struct pkcs11_manager_t pkcs11_manager_t;
        !            25: 
        !            26: #include <library.h>
        !            27: 
        !            28: #include "pkcs11_library.h"
        !            29: 
        !            30: /**
        !            31:  * Token event callback function.
        !            32:  *
        !            33:  * @param data         user supplied data, as passed to pkcs11_manager_create()
        !            34:  * @param p11          loaded PKCS#11 library token belongs to
        !            35:  * @param slot         slot number the event occurred in
        !            36:  * @param add          TRUE if token was added to the slot, FALSE if removed
        !            37:  */
        !            38: typedef void (*pkcs11_manager_token_event_t)(void *data, pkcs11_library_t *p11,
        !            39:                                                                                         CK_SLOT_ID slot, bool add);
        !            40: 
        !            41: 
        !            42: /**
        !            43:  * Manages multiple PKCS#11 libraries with hot pluggable slots
        !            44:  */
        !            45: struct pkcs11_manager_t {
        !            46: 
        !            47:        /**
        !            48:         * Create an enumerator over all tokens.
        !            49:         *
        !            50:         * @return                      enumerator over (pkcs11_library_t*,CK_SLOT_ID)
        !            51:         */
        !            52:        enumerator_t* (*create_token_enumerator)(pkcs11_manager_t *this);
        !            53: 
        !            54:        /**
        !            55:         * Destroy a pkcs11_manager_t.
        !            56:         */
        !            57:        void (*destroy)(pkcs11_manager_t *this);
        !            58: };
        !            59: 
        !            60: /**
        !            61:  * Create a pkcs11_manager instance.
        !            62:  *
        !            63:  * @param cb           token event callback function
        !            64:  * @param data         user data to pass to token event callback
        !            65:  * @return                     instance
        !            66:  */
        !            67: pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb,
        !            68:                                                                                void *data);
        !            69: 
        !            70: #endif /** PKCS11_MANAGER_H_ @}*/

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>