// CkPkcs11.h: interface for the CkPkcs11 class. // ////////////////////////////////////////////////////////////////////// // This header is generated for Chilkat 11.3.0 #define _CkVersion 11.3.0 #ifndef _CkPkcs11_H #define _CkPkcs11_H #include "chilkatDefs.h" #include "CkString.h" #include "CkMultiByteBase.h" class CkJsonObject; class CkPublicKey; class CkCert; class CkPrivateKey; class CkSshKey; #if !defined(__sun__) && !defined(__sun) #pragma pack (push, 8) #endif #undef Copy // CLASS: CkPkcs11 class CK_VISIBLE_PUBLIC CkPkcs11 : public CkMultiByteBase { private: // Don't allow assignment or copying these objects. CkPkcs11(const CkPkcs11 &); CkPkcs11 &operator=(const CkPkcs11 &); public: CkPkcs11(void); virtual ~CkPkcs11(void); static CkPkcs11 *createNew(void); static CkPkcs11 *createNew2(int progLang); void CK_VISIBLE_PRIVATE inject(void *impl); // May be called when finished with the object to free/dispose of any // internal resources held by the object. void dispose(void); // BEGIN PUBLIC INTERFACE // ---------------------- // Properties // ---------------------- // The number of certificates contained on the smart card or USB token. This // property is set when FindAllCerts is called. int get_NumCerts(void); // On Windows systems, then should be set to the name of the DLL file (if the DLL // is located in C:\Windows\System32), or it can be the full path to the DLL. // // On Linux, MacOSX, or other non-Windows systems, this can also be either the full // path to the .so or .dylib, or just the .so or .dylib filename. On these systems, // Chilkat calls the https://man7.org/linux/man-pages/man3/dlopen.3.html>dlopen // system function to load the shared library. If just the filename is passed in, // the directories searched are those indicated in the dlopen function description // at https://man7.org/linux/man-pages/man3/dlopen.3.html // // // References: // 1: dlopen // system function to load the shared library. If just the filename is passed in, // the directories searched are those indicated in the dlopen function description // at https://man7.org/linux/man-pages/man3/dlopen.3.html // // // References: // 1: dlopen // system function to load the shared library. If just the filename is passed in, // the directories searched are those indicated in the dlopen function description // at https://man7.org/linux/man-pages/man3/dlopen.3.html // // // References: // 1: // 2. Security Officer (0) // 3. Normal User (1) // 4. Context Specific (2) // // Except for special circumstances, you'll always login as the Normal User. // bool Login(int userType, const char *pin); // Logs out from a token (smart card). bool Logout(void); // Opens a session on the token (i.e. smart card). The slotId is the ID of the slot // (not the index). Set slotId equal to -1 to choose the first available non-empty // slot. The readWrite indicates whether the session should be read-only or read-write. // // The PKCS11 terminology is confusing: // // * A slot corresponds to a connected smart card reader or USB hardware token, // such as a Feitian ePass3003Auto token. // * A token corresponds to the smart card inserted into the reader. If we have // a USB hardware token, such as the epass3003Auto (or many others), then // technically there is always a smart card inserted, because the USB hardware // token is effectively both the reader and smart card wrapped in one inseparable // device. // * The PKCS11 DLL (or .so shared lib, or .dylib) is the vendor supplied // PKCS11 implementation (driver) that provides the low-level C PKCS11 // functions (called by Chilkat internally). // * Generally, the number of slots will equal the number of connected smart // cards or tokens belonging to the vendor of the DLL, or compatible with the DLL. // In most cases you'll have your single reader with a single smart card inserted, // and therefore only one slot exists. // * Some PKCS11 DLLs are provided by a 3rd party and support many smart cards. // For example, A.E.T. Europe B.V.'s SafeSign Identity Client Standard Version // 3.5 DLL is aetpkss1.dll . It supports the following tokens: // * Defensiepas // * Defensiepas 2 // * G&D Convego Join 4.01 40k/80k // * G&D SkySIM Hercules // * G&D SkySIM Scorpius // * G&D Sm@rtCafé Expert 3.2 // * G&D Sm@rtCafé Expert 4.0 // * G&D Sm@rtCafé Expert 5.0 // * G&D Sm@rtCafé Expert 6.0 // * G&D Sm@rtCafé Expert 7.0 // * G&D Sm@rtCafé Expert 64 // * Gemalto Desineo ICP D72 FXR1 Java // * Gemalto IDCore 30 // * Gemalto MultiApp ID v2.1 // * Gemalto Optelio D72 FR1 // * Gemalto TOP DL v2 // * Infineon Oracle JCOS Ed.1 // * JCOP21 v2.3 // * Morpho IDealCitiz v2.1 // * Morpho JMV ProCL V3.0 // * NXP J2A080 / J2A081 (JCOP 2.4.1 R3) // * NXP JD081 (JCOP 2.4.1 R3) // * NXP J3A080 (JCOP 2.4.1 R3) // * NXP JCOP 2.4.2 R3 // * NXP JCOP 3 SecID P60 // * Oberthur IDOne Cosmo v7.0 // * RDW ABR kaart // * Rijkspas // * Rijkspas 2 // * Sagem YpsID s2 // * Sagem YpsID s3 // * StarSign Crypto USB Token S // * Swissbit PS-100u SE // * UZI-pas // * UZI-pas 2 bool OpenSession(int slotId, bool readWrite); // Quickly establishes a session on the 1st unempty slot, with or without login. If // the pin is the empty string, then no login will take place. The userType can be one // of the following integer values: // 1. 0> // 2. Security Officer (0) // 3. Normal User (1) // 4. Context Specific (2) // // Except for special circumstances, you should always select Normal User. If pin // is the empty string, then no login takes place and userType is ignored. // // Calling this method takes the place of making separate calls to Initialize, // OpenSession, and Login. // bool QuickSession(int userType, const char *pin); // Modifies the PIN of the user that is currently logged in, or the Normal User PIN // if the session is not logged in. bool SetPin(const char *oldPin, const char *newPin); // END PUBLIC INTERFACE }; #if !defined(__sun__) && !defined(__sun) #pragma pack (pop) #endif #endif