Blame src/plugins/preauth/pkinit/pkcs11.h

Packit fd8b60
/*
Packit fd8b60
   Copyright 2006 g10 Code GmbH
Packit fd8b60
   Copyright 2006 Andreas Jellinghaus
Packit fd8b60
Packit fd8b60
   This file is free software; as a special exception the author gives
Packit fd8b60
   unlimited permission to copy and/or distribute it, with or without
Packit fd8b60
   modifications, as long as this notice is preserved.
Packit fd8b60
Packit fd8b60
   This file is distributed in the hope that it will be useful, but
Packit fd8b60
   WITHOUT ANY WARRANTY, to the extent permitted by law; without even
Packit fd8b60
   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Packit fd8b60
   PURPOSE.  */
Packit fd8b60
Packit fd8b60
/* Please submit changes back to the Scute project at
Packit fd8b60
   https://www.scute.org/ (or send them to marcus@g10code.com), so that
Packit fd8b60
   they can be picked up by other projects from there as well.  */
Packit fd8b60
Packit fd8b60
/* This file is a modified implementation of the PKCS #11 standard by
Packit fd8b60
   RSA Security Inc.  It is mostly a drop-in replacement, with the
Packit fd8b60
   following change:
Packit fd8b60
Packit fd8b60
   This header file does not require any macro definitions by the user
Packit fd8b60
   (like CK_DEFINE_FUNCTION etc).  In fact, it defines those macros
Packit fd8b60
   for you (if useful, some are missing, let me know if you need
Packit fd8b60
   more).
Packit fd8b60
Packit fd8b60
   There is an additional API available that does comply better to the
Packit fd8b60
   GNU coding standard.  It can be switched on by defining
Packit fd8b60
   CRYPTOKI_GNU before including this header file.  For this, the
Packit fd8b60
   following changes are made to the specification:
Packit fd8b60
Packit fd8b60
   All structure types are changed to a "struct ck_foo" where CK_FOO
Packit fd8b60
   is the type name in PKCS #11.
Packit fd8b60
Packit fd8b60
   All non-structure types are changed to ck_foo_t where CK_FOO is the
Packit fd8b60
   lowercase version of the type name in PKCS #11.  The basic types
Packit fd8b60
   (CK_ULONG et al.) are removed without substitute.
Packit fd8b60
Packit fd8b60
   All members of structures are modified in the following way: Type
Packit fd8b60
   indication prefixes are removed, and underscore characters are
Packit fd8b60
   inserted before words.  Then the result is lowercased.
Packit fd8b60
Packit fd8b60
   Note that function names are still in the original case, as they
Packit fd8b60
   need for ABI compatibility.
Packit fd8b60
Packit fd8b60
   CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute.  Use
Packit fd8b60
   <stdbool.h>.
Packit fd8b60
Packit fd8b60
   If CRYPTOKI_COMPAT is defined before including this header file,
Packit fd8b60
   then none of the API changes above take place, and the API is the
Packit fd8b60
   one defined by the PKCS #11 standard.  */
Packit fd8b60
Packit fd8b60
#ifndef PKCS11_H
Packit fd8b60
#define PKCS11_H 1
Packit fd8b60
Packit fd8b60
#if defined(__cplusplus)
Packit fd8b60
extern "C" {
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
Packit fd8b60
/* The version of cryptoki we implement.  The revision is changed with
Packit fd8b60
   each modification of this file.  If you do not use the "official"
Packit fd8b60
   version of this file, please consider deleting the revision macro
Packit fd8b60
   (you may use a macro with a different name to keep track of your
Packit fd8b60
   versions).  */
Packit fd8b60
#define CRYPTOKI_VERSION_MAJOR		2
Packit fd8b60
#define CRYPTOKI_VERSION_MINOR		20
Packit fd8b60
#define CRYPTOKI_VERSION_REVISION	6
Packit fd8b60
Packit fd8b60
Packit fd8b60
/* Compatibility interface is default, unless CRYPTOKI_GNU is
Packit fd8b60
   given.  */
Packit fd8b60
#ifndef CRYPTOKI_GNU
Packit fd8b60
#ifndef CRYPTOKI_COMPAT
Packit fd8b60
#define CRYPTOKI_COMPAT 1
Packit fd8b60
#endif
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
/* System dependencies.  */
Packit fd8b60
Packit fd8b60
#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32)
Packit fd8b60
Packit fd8b60
/* There is a matching pop below.  */
Packit fd8b60
#pragma pack(push, cryptoki, 1)
Packit fd8b60
Packit fd8b60
#ifdef CRYPTOKI_EXPORTS
Packit fd8b60
#define CK_SPEC __declspec(dllexport)
Packit fd8b60
#else
Packit fd8b60
#define CK_SPEC __declspec(dllimport)
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
#else
Packit fd8b60
Packit fd8b60
#define CK_SPEC
Packit fd8b60
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
#ifdef CRYPTOKI_COMPAT
Packit fd8b60
  /* If we are in compatibility mode, switch all exposed names to the
Packit fd8b60
     PKCS #11 variant.  There are corresponding #undefs below.  */
Packit fd8b60
Packit fd8b60
#define ck_flags_t CK_FLAGS
Packit fd8b60
#define ck_version _CK_VERSION
Packit fd8b60
Packit fd8b60
#define ck_info _CK_INFO
Packit fd8b60
#define cryptoki_version cryptokiVersion
Packit fd8b60
#define manufacturer_id manufacturerID
Packit fd8b60
#define library_description libraryDescription
Packit fd8b60
#define library_version libraryVersion
Packit fd8b60
Packit fd8b60
#define ck_notification_t CK_NOTIFICATION
Packit fd8b60
#define ck_slot_id_t CK_SLOT_ID
Packit fd8b60
Packit fd8b60
#define ck_slot_info _CK_SLOT_INFO
Packit fd8b60
#define slot_description slotDescription
Packit fd8b60
#define hardware_version hardwareVersion
Packit fd8b60
#define firmware_version firmwareVersion
Packit fd8b60
Packit fd8b60
#define ck_token_info _CK_TOKEN_INFO
Packit fd8b60
#define serial_number serialNumber
Packit fd8b60
#define max_session_count ulMaxSessionCount
Packit fd8b60
#define session_count ulSessionCount
Packit fd8b60
#define max_rw_session_count ulMaxRwSessionCount
Packit fd8b60
#define rw_session_count ulRwSessionCount
Packit fd8b60
#define max_pin_len ulMaxPinLen
Packit fd8b60
#define min_pin_len ulMinPinLen
Packit fd8b60
#define total_public_memory ulTotalPublicMemory
Packit fd8b60
#define free_public_memory ulFreePublicMemory
Packit fd8b60
#define total_private_memory ulTotalPrivateMemory
Packit fd8b60
#define free_private_memory ulFreePrivateMemory
Packit fd8b60
#define utc_time utcTime
Packit fd8b60
Packit fd8b60
#define ck_session_handle_t CK_SESSION_HANDLE
Packit fd8b60
#define ck_user_type_t CK_USER_TYPE
Packit fd8b60
#define ck_state_t CK_STATE
Packit fd8b60
Packit fd8b60
#define ck_session_info _CK_SESSION_INFO
Packit fd8b60
#define slot_id slotID
Packit fd8b60
#define device_error ulDeviceError
Packit fd8b60
Packit fd8b60
#define ck_object_handle_t CK_OBJECT_HANDLE
Packit fd8b60
#define ck_object_class_t CK_OBJECT_CLASS
Packit fd8b60
#define ck_hw_feature_type_t CK_HW_FEATURE_TYPE
Packit fd8b60
#define ck_key_type_t CK_KEY_TYPE
Packit fd8b60
#define ck_certificate_type_t CK_CERTIFICATE_TYPE
Packit fd8b60
#define ck_attribute_type_t CK_ATTRIBUTE_TYPE
Packit fd8b60
Packit fd8b60
#define ck_attribute _CK_ATTRIBUTE
Packit fd8b60
#define value pValue
Packit fd8b60
#define value_len ulValueLen
Packit fd8b60
Packit fd8b60
#define ck_date _CK_DATE
Packit fd8b60
Packit fd8b60
#define ck_mechanism_type_t CK_MECHANISM_TYPE
Packit fd8b60
Packit fd8b60
#define ck_mechanism _CK_MECHANISM
Packit fd8b60
#define parameter pParameter
Packit fd8b60
#define parameter_len ulParameterLen
Packit fd8b60
Packit fd8b60
#define ck_mechanism_info _CK_MECHANISM_INFO
Packit fd8b60
#define min_key_size ulMinKeySize
Packit fd8b60
#define max_key_size ulMaxKeySize
Packit fd8b60
Packit fd8b60
#define ck_rv_t CK_RV
Packit fd8b60
#define ck_notify_t CK_NOTIFY
Packit fd8b60
Packit fd8b60
#define ck_function_list _CK_FUNCTION_LIST
Packit fd8b60
Packit fd8b60
#define ck_createmutex_t CK_CREATEMUTEX
Packit fd8b60
#define ck_destroymutex_t CK_DESTROYMUTEX
Packit fd8b60
#define ck_lockmutex_t CK_LOCKMUTEX
Packit fd8b60
#define ck_unlockmutex_t CK_UNLOCKMUTEX
Packit fd8b60
Packit fd8b60
#define ck_c_initialize_args _CK_C_INITIALIZE_ARGS
Packit fd8b60
#define create_mutex CreateMutex
Packit fd8b60
#define destroy_mutex DestroyMutex
Packit fd8b60
#define lock_mutex LockMutex
Packit fd8b60
#define unlock_mutex UnlockMutex
Packit fd8b60
#define reserved pReserved
Packit fd8b60
Packit fd8b60
#endif	/* CRYPTOKI_COMPAT */
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_flags_t;
Packit fd8b60
Packit fd8b60
struct ck_version
Packit fd8b60
{
Packit fd8b60
  unsigned char major;
Packit fd8b60
  unsigned char minor;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_info
Packit fd8b60
{
Packit fd8b60
  struct ck_version cryptoki_version;
Packit fd8b60
  unsigned char manufacturer_id[32];
Packit fd8b60
  ck_flags_t flags;
Packit fd8b60
  unsigned char library_description[32];
Packit fd8b60
  struct ck_version library_version;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_notification_t;
Packit fd8b60
Packit fd8b60
#define CKN_SURRENDER	(0)
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_slot_id_t;
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_slot_info
Packit fd8b60
{
Packit fd8b60
  unsigned char slot_description[64];
Packit fd8b60
  unsigned char manufacturer_id[32];
Packit fd8b60
  ck_flags_t flags;
Packit fd8b60
  struct ck_version hardware_version;
Packit fd8b60
  struct ck_version firmware_version;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
#define CKF_TOKEN_PRESENT	(1 << 0)
Packit fd8b60
#define CKF_REMOVABLE_DEVICE	(1 << 1)
Packit fd8b60
#define CKF_HW_SLOT		(1 << 2)
Packit fd8b60
#define CKF_ARRAY_ATTRIBUTE	(1 << 30)
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_token_info
Packit fd8b60
{
Packit fd8b60
  unsigned char label[32];
Packit fd8b60
  unsigned char manufacturer_id[32];
Packit fd8b60
  unsigned char model[16];
Packit fd8b60
  unsigned char serial_number[16];
Packit fd8b60
  ck_flags_t flags;
Packit fd8b60
  unsigned long max_session_count;
Packit fd8b60
  unsigned long session_count;
Packit fd8b60
  unsigned long max_rw_session_count;
Packit fd8b60
  unsigned long rw_session_count;
Packit fd8b60
  unsigned long max_pin_len;
Packit fd8b60
  unsigned long min_pin_len;
Packit fd8b60
  unsigned long total_public_memory;
Packit fd8b60
  unsigned long free_public_memory;
Packit fd8b60
  unsigned long total_private_memory;
Packit fd8b60
  unsigned long free_private_memory;
Packit fd8b60
  struct ck_version hardware_version;
Packit fd8b60
  struct ck_version firmware_version;
Packit fd8b60
  unsigned char utc_time[16];
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
#define CKF_RNG					(1 << 0)
Packit fd8b60
#define CKF_WRITE_PROTECTED			(1 << 1)
Packit fd8b60
#define CKF_LOGIN_REQUIRED			(1 << 2)
Packit fd8b60
#define CKF_USER_PIN_INITIALIZED		(1 << 3)
Packit fd8b60
#define CKF_RESTORE_KEY_NOT_NEEDED		(1 << 5)
Packit fd8b60
#define CKF_CLOCK_ON_TOKEN			(1 << 6)
Packit fd8b60
#define CKF_PROTECTED_AUTHENTICATION_PATH	(1 << 8)
Packit fd8b60
#define CKF_DUAL_CRYPTO_OPERATIONS		(1 << 9)
Packit fd8b60
#define CKF_TOKEN_INITIALIZED			(1 << 10)
Packit fd8b60
#define CKF_SECONDARY_AUTHENTICATION		(1 << 11)
Packit fd8b60
#define CKF_USER_PIN_COUNT_LOW			(1 << 16)
Packit fd8b60
#define CKF_USER_PIN_FINAL_TRY			(1 << 17)
Packit fd8b60
#define CKF_USER_PIN_LOCKED			(1 << 18)
Packit fd8b60
#define CKF_USER_PIN_TO_BE_CHANGED		(1 << 19)
Packit fd8b60
#define CKF_SO_PIN_COUNT_LOW			(1 << 20)
Packit fd8b60
#define CKF_SO_PIN_FINAL_TRY			(1 << 21)
Packit fd8b60
#define CKF_SO_PIN_LOCKED			(1 << 22)
Packit fd8b60
#define CKF_SO_PIN_TO_BE_CHANGED		(1 << 23)
Packit fd8b60
Packit fd8b60
#define CK_UNAVAILABLE_INFORMATION	((unsigned long) -1)
Packit fd8b60
#define CK_EFFECTIVELY_INFINITE		(0)
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_session_handle_t;
Packit fd8b60
Packit fd8b60
#define CK_INVALID_HANDLE	(0)
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_user_type_t;
Packit fd8b60
Packit fd8b60
#define CKU_SO			(0)
Packit fd8b60
#define CKU_USER		(1)
Packit fd8b60
#define CKU_CONTEXT_SPECIFIC	(2)
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_state_t;
Packit fd8b60
Packit fd8b60
#define CKS_RO_PUBLIC_SESSION	(0)
Packit fd8b60
#define CKS_RO_USER_FUNCTIONS	(1)
Packit fd8b60
#define CKS_RW_PUBLIC_SESSION	(2)
Packit fd8b60
#define CKS_RW_USER_FUNCTIONS	(3)
Packit fd8b60
#define CKS_RW_SO_FUNCTIONS	(4)
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_session_info
Packit fd8b60
{
Packit fd8b60
  ck_slot_id_t slot_id;
Packit fd8b60
  ck_state_t state;
Packit fd8b60
  ck_flags_t flags;
Packit fd8b60
  unsigned long device_error;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
#define CKF_RW_SESSION		(1 << 1)
Packit fd8b60
#define CKF_SERIAL_SESSION	(1 << 2)
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_object_handle_t;
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_object_class_t;
Packit fd8b60
Packit fd8b60
#define CKO_DATA		(0)
Packit fd8b60
#define CKO_CERTIFICATE		(1)
Packit fd8b60
#define CKO_PUBLIC_KEY		(2)
Packit fd8b60
#define CKO_PRIVATE_KEY		(3)
Packit fd8b60
#define CKO_SECRET_KEY		(4)
Packit fd8b60
#define CKO_HW_FEATURE		(5)
Packit fd8b60
#define CKO_DOMAIN_PARAMETERS	(6)
Packit fd8b60
#define CKO_MECHANISM		(7)
Packit fd8b60
#define CKO_VENDOR_DEFINED	((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_hw_feature_type_t;
Packit fd8b60
Packit fd8b60
#define CKH_MONOTONIC_COUNTER	(1)
Packit fd8b60
#define CKH_CLOCK		(2)
Packit fd8b60
#define CKH_USER_INTERFACE	(3)
Packit fd8b60
#define CKH_VENDOR_DEFINED	((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_key_type_t;
Packit fd8b60
Packit fd8b60
#define CKK_RSA			(0)
Packit fd8b60
#define CKK_DSA			(1)
Packit fd8b60
#define CKK_DH			(2)
Packit fd8b60
#define CKK_ECDSA		(3)
Packit fd8b60
#define CKK_EC			(3)
Packit fd8b60
#define CKK_X9_42_DH		(4)
Packit fd8b60
#define CKK_KEA			(5)
Packit fd8b60
#define CKK_GENERIC_SECRET	(0x10)
Packit fd8b60
#define CKK_RC2			(0x11)
Packit fd8b60
#define CKK_RC4			(0x12)
rpm-build 1cb403
/* #define CKK_DES			(0x13) */
rpm-build 1cb403
/* #define CKK_DES2		(0x14) */
rpm-build 1cb403
/* #define CKK_DES3		(0x15) */
Packit fd8b60
#define CKK_CAST		(0x16)
Packit fd8b60
#define CKK_CAST3		(0x17)
Packit fd8b60
#define CKK_CAST128		(0x18)
Packit fd8b60
#define CKK_RC5			(0x19)
Packit fd8b60
#define CKK_IDEA		(0x1a)
Packit fd8b60
#define CKK_SKIPJACK		(0x1b)
Packit fd8b60
#define CKK_BATON		(0x1c)
Packit fd8b60
#define CKK_JUNIPER		(0x1d)
Packit fd8b60
#define CKK_CDMF		(0x1e)
Packit fd8b60
#define CKK_AES			(0x1f)
Packit fd8b60
#define CKK_BLOWFISH		(0x20)
Packit fd8b60
#define CKK_TWOFISH		(0x21)
Packit fd8b60
#define CKK_VENDOR_DEFINED	((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_certificate_type_t;
Packit fd8b60
Packit fd8b60
#define CKC_X_509		(0)
Packit fd8b60
#define CKC_X_509_ATTR_CERT	(1)
Packit fd8b60
#define CKC_WTLS		(2)
Packit fd8b60
#define CKC_VENDOR_DEFINED	((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_attribute_type_t;
Packit fd8b60
Packit fd8b60
#define CKA_CLASS			(0)
Packit fd8b60
#define CKA_TOKEN			(1)
Packit fd8b60
#define CKA_PRIVATE			(2)
Packit fd8b60
#define CKA_LABEL			(3)
Packit fd8b60
#define CKA_APPLICATION			(0x10)
Packit fd8b60
#define CKA_VALUE			(0x11)
Packit fd8b60
#define CKA_OBJECT_ID			(0x12)
Packit fd8b60
#define CKA_CERTIFICATE_TYPE		(0x80)
Packit fd8b60
#define CKA_ISSUER			(0x81)
Packit fd8b60
#define CKA_SERIAL_NUMBER		(0x82)
Packit fd8b60
#define CKA_AC_ISSUER			(0x83)
Packit fd8b60
#define CKA_OWNER			(0x84)
Packit fd8b60
#define CKA_ATTR_TYPES			(0x85)
Packit fd8b60
#define CKA_TRUSTED			(0x86)
Packit fd8b60
#define CKA_CERTIFICATE_CATEGORY	(0x87)
Packit fd8b60
#define CKA_JAVA_MIDP_SECURITY_DOMAIN	(0x88)
Packit fd8b60
#define CKA_URL				(0x89)
Packit fd8b60
#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY	(0x8a)
Packit fd8b60
#define CKA_HASH_OF_ISSUER_PUBLIC_KEY	(0x8b)
Packit fd8b60
#define CKA_CHECK_VALUE			(0x90)
Packit fd8b60
#define CKA_KEY_TYPE			(0x100)
Packit fd8b60
#define CKA_SUBJECT			(0x101)
Packit fd8b60
#define CKA_ID				(0x102)
Packit fd8b60
#define CKA_SENSITIVE			(0x103)
Packit fd8b60
#define CKA_ENCRYPT			(0x104)
Packit fd8b60
#define CKA_DECRYPT			(0x105)
Packit fd8b60
#define CKA_WRAP			(0x106)
Packit fd8b60
#define CKA_UNWRAP			(0x107)
Packit fd8b60
#define CKA_SIGN			(0x108)
Packit fd8b60
#define CKA_SIGN_RECOVER		(0x109)
Packit fd8b60
#define CKA_VERIFY			(0x10a)
Packit fd8b60
#define CKA_VERIFY_RECOVER		(0x10b)
Packit fd8b60
#define CKA_DERIVE			(0x10c)
Packit fd8b60
#define CKA_START_DATE			(0x110)
Packit fd8b60
#define CKA_END_DATE			(0x111)
Packit fd8b60
#define CKA_MODULUS			(0x120)
Packit fd8b60
#define CKA_MODULUS_BITS		(0x121)
Packit fd8b60
#define CKA_PUBLIC_EXPONENT		(0x122)
Packit fd8b60
#define CKA_PRIVATE_EXPONENT		(0x123)
Packit fd8b60
#define CKA_PRIME_1			(0x124)
Packit fd8b60
#define CKA_PRIME_2			(0x125)
Packit fd8b60
#define CKA_EXPONENT_1			(0x126)
Packit fd8b60
#define CKA_EXPONENT_2			(0x127)
Packit fd8b60
#define CKA_COEFFICIENT			(0x128)
Packit fd8b60
#define CKA_PRIME			(0x130)
Packit fd8b60
#define CKA_SUBPRIME			(0x131)
Packit fd8b60
#define CKA_BASE			(0x132)
Packit fd8b60
#define CKA_PRIME_BITS			(0x133)
Packit fd8b60
#define CKA_SUB_PRIME_BITS		(0x134)
Packit fd8b60
#define CKA_VALUE_BITS			(0x160)
Packit fd8b60
#define CKA_VALUE_LEN			(0x161)
Packit fd8b60
#define CKA_EXTRACTABLE			(0x162)
Packit fd8b60
#define CKA_LOCAL			(0x163)
Packit fd8b60
#define CKA_NEVER_EXTRACTABLE		(0x164)
Packit fd8b60
#define CKA_ALWAYS_SENSITIVE		(0x165)
Packit fd8b60
#define CKA_KEY_GEN_MECHANISM		(0x166)
Packit fd8b60
#define CKA_MODIFIABLE			(0x170)
Packit fd8b60
#define CKA_ECDSA_PARAMS		(0x180)
Packit fd8b60
#define CKA_EC_PARAMS			(0x180)
Packit fd8b60
#define CKA_EC_POINT			(0x181)
Packit fd8b60
#define CKA_SECONDARY_AUTH		(0x200)
Packit fd8b60
#define CKA_AUTH_PIN_FLAGS		(0x201)
Packit fd8b60
#define CKA_ALWAYS_AUTHENTICATE		(0x202)
Packit fd8b60
#define CKA_WRAP_WITH_TRUSTED		(0x210)
Packit fd8b60
#define CKA_HW_FEATURE_TYPE		(0x300)
Packit fd8b60
#define CKA_RESET_ON_INIT		(0x301)
Packit fd8b60
#define CKA_HAS_RESET			(0x302)
Packit fd8b60
#define CKA_PIXEL_X			(0x400)
Packit fd8b60
#define CKA_PIXEL_Y			(0x401)
Packit fd8b60
#define CKA_RESOLUTION			(0x402)
Packit fd8b60
#define CKA_CHAR_ROWS			(0x403)
Packit fd8b60
#define CKA_CHAR_COLUMNS		(0x404)
Packit fd8b60
#define CKA_COLOR			(0x405)
Packit fd8b60
#define CKA_BITS_PER_PIXEL		(0x406)
Packit fd8b60
#define CKA_CHAR_SETS			(0x480)
Packit fd8b60
#define CKA_ENCODING_METHODS		(0x481)
Packit fd8b60
#define CKA_MIME_TYPES			(0x482)
Packit fd8b60
#define CKA_MECHANISM_TYPE		(0x500)
Packit fd8b60
#define CKA_REQUIRED_CMS_ATTRIBUTES	(0x501)
Packit fd8b60
#define CKA_DEFAULT_CMS_ATTRIBUTES	(0x502)
Packit fd8b60
#define CKA_SUPPORTED_CMS_ATTRIBUTES	(0x503)
Packit fd8b60
#define CKA_WRAP_TEMPLATE		(CKF_ARRAY_ATTRIBUTE | 0x211)
Packit fd8b60
#define CKA_UNWRAP_TEMPLATE		(CKF_ARRAY_ATTRIBUTE | 0x212)
Packit fd8b60
#define CKA_ALLOWED_MECHANISMS		(CKF_ARRAY_ATTRIBUTE | 0x600)
Packit fd8b60
#define CKA_VENDOR_DEFINED		((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_attribute
Packit fd8b60
{
Packit fd8b60
  ck_attribute_type_t type;
Packit fd8b60
  void *value;
Packit fd8b60
  unsigned long value_len;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_date
Packit fd8b60
{
Packit fd8b60
  unsigned char year[4];
Packit fd8b60
  unsigned char month[2];
Packit fd8b60
  unsigned char day[2];
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_mechanism_type_t;
Packit fd8b60
Packit fd8b60
#define CKM_RSA_PKCS_KEY_PAIR_GEN	(0)
Packit fd8b60
#define CKM_RSA_PKCS			(1)
Packit fd8b60
#define CKM_RSA_9796			(2)
Packit fd8b60
#define CKM_RSA_X_509			(3)
Packit fd8b60
#define CKM_MD2_RSA_PKCS		(4)
Packit fd8b60
#define CKM_MD5_RSA_PKCS		(5)
Packit fd8b60
#define CKM_SHA1_RSA_PKCS		(6)
Packit fd8b60
#define CKM_RIPEMD128_RSA_PKCS		(7)
Packit fd8b60
#define CKM_RIPEMD160_RSA_PKCS		(8)
Packit fd8b60
#define CKM_RSA_PKCS_OAEP		(9)
Packit fd8b60
#define CKM_RSA_X9_31_KEY_PAIR_GEN	(0xa)
Packit fd8b60
#define CKM_RSA_X9_31			(0xb)
Packit fd8b60
#define CKM_SHA1_RSA_X9_31		(0xc)
Packit fd8b60
#define CKM_RSA_PKCS_PSS		(0xd)
Packit fd8b60
#define CKM_SHA1_RSA_PKCS_PSS		(0xe)
Packit fd8b60
#define CKM_DSA_KEY_PAIR_GEN		(0x10)
Packit fd8b60
#define	CKM_DSA				(0x11)
Packit fd8b60
#define CKM_DSA_SHA1			(0x12)
Packit fd8b60
#define CKM_DH_PKCS_KEY_PAIR_GEN	(0x20)
Packit fd8b60
#define CKM_DH_PKCS_DERIVE		(0x21)
Packit fd8b60
#define	CKM_X9_42_DH_KEY_PAIR_GEN	(0x30)
Packit fd8b60
#define CKM_X9_42_DH_DERIVE		(0x31)
Packit fd8b60
#define CKM_X9_42_DH_HYBRID_DERIVE	(0x32)
Packit fd8b60
#define CKM_X9_42_MQV_DERIVE		(0x33)
Packit fd8b60
#define CKM_SHA256_RSA_PKCS		(0x40)
Packit fd8b60
#define CKM_SHA384_RSA_PKCS		(0x41)
Packit fd8b60
#define CKM_SHA512_RSA_PKCS		(0x42)
Packit fd8b60
#define CKM_SHA256_RSA_PKCS_PSS		(0x43)
Packit fd8b60
#define CKM_SHA384_RSA_PKCS_PSS		(0x44)
Packit fd8b60
#define CKM_SHA512_RSA_PKCS_PSS		(0x45)
Packit fd8b60
#define CKM_RC2_KEY_GEN			(0x100)
Packit fd8b60
#define CKM_RC2_ECB			(0x101)
Packit fd8b60
#define	CKM_RC2_CBC			(0x102)
Packit fd8b60
#define	CKM_RC2_MAC			(0x103)
Packit fd8b60
#define CKM_RC2_MAC_GENERAL		(0x104)
Packit fd8b60
#define CKM_RC2_CBC_PAD			(0x105)
Packit fd8b60
#define CKM_RC4_KEY_GEN			(0x110)
Packit fd8b60
#define CKM_RC4				(0x111)
Packit fd8b60
#define CKM_DES_KEY_GEN			(0x120)
Packit fd8b60
#define CKM_DES_ECB			(0x121)
Packit fd8b60
#define CKM_DES_CBC			(0x122)
Packit fd8b60
#define CKM_DES_MAC			(0x123)
Packit fd8b60
#define CKM_DES_MAC_GENERAL		(0x124)
Packit fd8b60
#define CKM_DES_CBC_PAD			(0x125)
Packit fd8b60
#define CKM_DES2_KEY_GEN		(0x130)
Packit fd8b60
#define CKM_DES3_KEY_GEN		(0x131)
Packit fd8b60
#define CKM_DES3_ECB			(0x132)
Packit fd8b60
#define CKM_DES3_CBC			(0x133)
Packit fd8b60
#define CKM_DES3_MAC			(0x134)
Packit fd8b60
#define CKM_DES3_MAC_GENERAL		(0x135)
Packit fd8b60
#define CKM_DES3_CBC_PAD		(0x136)
Packit fd8b60
#define CKM_CDMF_KEY_GEN		(0x140)
Packit fd8b60
#define CKM_CDMF_ECB			(0x141)
Packit fd8b60
#define CKM_CDMF_CBC			(0x142)
Packit fd8b60
#define CKM_CDMF_MAC			(0x143)
Packit fd8b60
#define CKM_CDMF_MAC_GENERAL		(0x144)
Packit fd8b60
#define CKM_CDMF_CBC_PAD		(0x145)
Packit fd8b60
#define CKM_MD2				(0x200)
Packit fd8b60
#define CKM_MD2_HMAC			(0x201)
Packit fd8b60
#define CKM_MD2_HMAC_GENERAL		(0x202)
Packit fd8b60
#define CKM_MD5				(0x210)
Packit fd8b60
#define CKM_MD5_HMAC			(0x211)
Packit fd8b60
#define CKM_MD5_HMAC_GENERAL		(0x212)
Packit fd8b60
#define CKM_SHA_1			(0x220)
Packit fd8b60
#define CKM_SHA_1_HMAC			(0x221)
Packit fd8b60
#define CKM_SHA_1_HMAC_GENERAL		(0x222)
Packit fd8b60
#define CKM_RIPEMD128			(0x230)
Packit fd8b60
#define CKM_RIPEMD128_HMAC		(0x231)
Packit fd8b60
#define CKM_RIPEMD128_HMAC_GENERAL	(0x232)
Packit fd8b60
#define CKM_RIPEMD160			(0x240)
Packit fd8b60
#define CKM_RIPEMD160_HMAC		(0x241)
Packit fd8b60
#define CKM_RIPEMD160_HMAC_GENERAL	(0x242)
Packit fd8b60
#define CKM_SHA256			(0x250)
Packit fd8b60
#define CKM_SHA256_HMAC			(0x251)
Packit fd8b60
#define CKM_SHA256_HMAC_GENERAL		(0x252)
Packit fd8b60
#define CKM_SHA384			(0x260)
Packit fd8b60
#define CKM_SHA384_HMAC			(0x261)
Packit fd8b60
#define CKM_SHA384_HMAC_GENERAL		(0x262)
Packit fd8b60
#define CKM_SHA512			(0x270)
Packit fd8b60
#define CKM_SHA512_HMAC			(0x271)
Packit fd8b60
#define CKM_SHA512_HMAC_GENERAL		(0x272)
Packit fd8b60
#define CKM_CAST_KEY_GEN		(0x300)
Packit fd8b60
#define CKM_CAST_ECB			(0x301)
Packit fd8b60
#define CKM_CAST_CBC			(0x302)
Packit fd8b60
#define CKM_CAST_MAC			(0x303)
Packit fd8b60
#define CKM_CAST_MAC_GENERAL		(0x304)
Packit fd8b60
#define CKM_CAST_CBC_PAD		(0x305)
Packit fd8b60
#define CKM_CAST3_KEY_GEN		(0x310)
Packit fd8b60
#define CKM_CAST3_ECB			(0x311)
Packit fd8b60
#define CKM_CAST3_CBC			(0x312)
Packit fd8b60
#define CKM_CAST3_MAC			(0x313)
Packit fd8b60
#define CKM_CAST3_MAC_GENERAL		(0x314)
Packit fd8b60
#define CKM_CAST3_CBC_PAD		(0x315)
Packit fd8b60
#define CKM_CAST5_KEY_GEN		(0x320)
Packit fd8b60
#define CKM_CAST128_KEY_GEN		(0x320)
Packit fd8b60
#define CKM_CAST5_ECB			(0x321)
Packit fd8b60
#define CKM_CAST128_ECB			(0x321)
Packit fd8b60
#define CKM_CAST5_CBC			(0x322)
Packit fd8b60
#define CKM_CAST128_CBC			(0x322)
Packit fd8b60
#define CKM_CAST5_MAC			(0x323)
Packit fd8b60
#define	CKM_CAST128_MAC			(0x323)
Packit fd8b60
#define CKM_CAST5_MAC_GENERAL		(0x324)
Packit fd8b60
#define CKM_CAST128_MAC_GENERAL		(0x324)
Packit fd8b60
#define CKM_CAST5_CBC_PAD		(0x325)
Packit fd8b60
#define CKM_CAST128_CBC_PAD		(0x325)
Packit fd8b60
#define CKM_RC5_KEY_GEN			(0x330)
Packit fd8b60
#define CKM_RC5_ECB			(0x331)
Packit fd8b60
#define CKM_RC5_CBC			(0x332)
Packit fd8b60
#define CKM_RC5_MAC			(0x333)
Packit fd8b60
#define CKM_RC5_MAC_GENERAL		(0x334)
Packit fd8b60
#define CKM_RC5_CBC_PAD			(0x335)
Packit fd8b60
#define CKM_IDEA_KEY_GEN		(0x340)
Packit fd8b60
#define CKM_IDEA_ECB			(0x341)
Packit fd8b60
#define	CKM_IDEA_CBC			(0x342)
Packit fd8b60
#define CKM_IDEA_MAC			(0x343)
Packit fd8b60
#define CKM_IDEA_MAC_GENERAL		(0x344)
Packit fd8b60
#define CKM_IDEA_CBC_PAD		(0x345)
Packit fd8b60
#define CKM_GENERIC_SECRET_KEY_GEN	(0x350)
Packit fd8b60
#define CKM_CONCATENATE_BASE_AND_KEY	(0x360)
Packit fd8b60
#define CKM_CONCATENATE_BASE_AND_DATA	(0x362)
Packit fd8b60
#define CKM_CONCATENATE_DATA_AND_BASE	(0x363)
Packit fd8b60
#define CKM_XOR_BASE_AND_DATA		(0x364)
Packit fd8b60
#define CKM_EXTRACT_KEY_FROM_KEY	(0x365)
Packit fd8b60
#define CKM_SSL3_PRE_MASTER_KEY_GEN	(0x370)
Packit fd8b60
#define CKM_SSL3_MASTER_KEY_DERIVE	(0x371)
Packit fd8b60
#define CKM_SSL3_KEY_AND_MAC_DERIVE	(0x372)
Packit fd8b60
#define CKM_SSL3_MASTER_KEY_DERIVE_DH	(0x373)
Packit fd8b60
#define CKM_TLS_PRE_MASTER_KEY_GEN	(0x374)
Packit fd8b60
#define CKM_TLS_MASTER_KEY_DERIVE	(0x375)
Packit fd8b60
#define CKM_TLS_KEY_AND_MAC_DERIVE	(0x376)
Packit fd8b60
#define CKM_TLS_MASTER_KEY_DERIVE_DH	(0x377)
Packit fd8b60
#define CKM_SSL3_MD5_MAC		(0x380)
Packit fd8b60
#define CKM_SSL3_SHA1_MAC		(0x381)
Packit fd8b60
#define CKM_MD5_KEY_DERIVATION		(0x390)
Packit fd8b60
#define CKM_MD2_KEY_DERIVATION		(0x391)
Packit fd8b60
#define CKM_SHA1_KEY_DERIVATION		(0x392)
Packit fd8b60
#define CKM_PBE_MD2_DES_CBC		(0x3a0)
Packit fd8b60
#define CKM_PBE_MD5_DES_CBC		(0x3a1)
Packit fd8b60
#define CKM_PBE_MD5_CAST_CBC		(0x3a2)
Packit fd8b60
#define CKM_PBE_MD5_CAST3_CBC		(0x3a3)
Packit fd8b60
#define CKM_PBE_MD5_CAST5_CBC		(0x3a4)
Packit fd8b60
#define CKM_PBE_MD5_CAST128_CBC		(0x3a4)
Packit fd8b60
#define CKM_PBE_SHA1_CAST5_CBC		(0x3a5)
Packit fd8b60
#define CKM_PBE_SHA1_CAST128_CBC	(0x3a5)
Packit fd8b60
#define CKM_PBE_SHA1_RC4_128		(0x3a6)
Packit fd8b60
#define CKM_PBE_SHA1_RC4_40		(0x3a7)
Packit fd8b60
#define CKM_PBE_SHA1_DES3_EDE_CBC	(0x3a8)
Packit fd8b60
#define CKM_PBE_SHA1_DES2_EDE_CBC	(0x3a9)
Packit fd8b60
#define CKM_PBE_SHA1_RC2_128_CBC	(0x3aa)
Packit fd8b60
#define CKM_PBE_SHA1_RC2_40_CBC		(0x3ab)
Packit fd8b60
#define CKM_PKCS5_PBKD2			(0x3b0)
Packit fd8b60
#define CKM_PBA_SHA1_WITH_SHA1_HMAC	(0x3c0)
Packit fd8b60
#define CKM_KEY_WRAP_LYNKS		(0x400)
Packit fd8b60
#define CKM_KEY_WRAP_SET_OAEP		(0x401)
Packit fd8b60
#define CKM_SKIPJACK_KEY_GEN		(0x1000)
Packit fd8b60
#define CKM_SKIPJACK_ECB64		(0x1001)
Packit fd8b60
#define CKM_SKIPJACK_CBC64		(0x1002)
Packit fd8b60
#define CKM_SKIPJACK_OFB64		(0x1003)
Packit fd8b60
#define CKM_SKIPJACK_CFB64		(0x1004)
Packit fd8b60
#define CKM_SKIPJACK_CFB32		(0x1005)
Packit fd8b60
#define CKM_SKIPJACK_CFB16		(0x1006)
Packit fd8b60
#define CKM_SKIPJACK_CFB8		(0x1007)
Packit fd8b60
#define CKM_SKIPJACK_WRAP		(0x1008)
Packit fd8b60
#define CKM_SKIPJACK_PRIVATE_WRAP	(0x1009)
Packit fd8b60
#define CKM_SKIPJACK_RELAYX		(0x100a)
Packit fd8b60
#define CKM_KEA_KEY_PAIR_GEN		(0x1010)
Packit fd8b60
#define CKM_KEA_KEY_DERIVE		(0x1011)
Packit fd8b60
#define CKM_FORTEZZA_TIMESTAMP		(0x1020)
Packit fd8b60
#define CKM_BATON_KEY_GEN		(0x1030)
Packit fd8b60
#define CKM_BATON_ECB128		(0x1031)
Packit fd8b60
#define CKM_BATON_ECB96			(0x1032)
Packit fd8b60
#define CKM_BATON_CBC128		(0x1033)
Packit fd8b60
#define CKM_BATON_COUNTER		(0x1034)
Packit fd8b60
#define CKM_BATON_SHUFFLE		(0x1035)
Packit fd8b60
#define CKM_BATON_WRAP			(0x1036)
Packit fd8b60
#define CKM_ECDSA_KEY_PAIR_GEN		(0x1040)
Packit fd8b60
#define CKM_EC_KEY_PAIR_GEN		(0x1040)
Packit fd8b60
#define CKM_ECDSA			(0x1041)
Packit fd8b60
#define CKM_ECDSA_SHA1			(0x1042)
Packit fd8b60
#define CKM_ECDH1_DERIVE		(0x1050)
Packit fd8b60
#define CKM_ECDH1_COFACTOR_DERIVE	(0x1051)
Packit fd8b60
#define CKM_ECMQV_DERIVE		(0x1052)
Packit fd8b60
#define CKM_JUNIPER_KEY_GEN		(0x1060)
Packit fd8b60
#define CKM_JUNIPER_ECB128		(0x1061)
Packit fd8b60
#define CKM_JUNIPER_CBC128		(0x1062)
Packit fd8b60
#define CKM_JUNIPER_COUNTER		(0x1063)
Packit fd8b60
#define CKM_JUNIPER_SHUFFLE		(0x1064)
Packit fd8b60
#define CKM_JUNIPER_WRAP		(0x1065)
Packit fd8b60
#define CKM_FASTHASH			(0x1070)
Packit fd8b60
#define CKM_AES_KEY_GEN			(0x1080)
Packit fd8b60
#define CKM_AES_ECB			(0x1081)
Packit fd8b60
#define CKM_AES_CBC			(0x1082)
Packit fd8b60
#define CKM_AES_MAC			(0x1083)
Packit fd8b60
#define CKM_AES_MAC_GENERAL		(0x1084)
Packit fd8b60
#define CKM_AES_CBC_PAD			(0x1085)
Packit fd8b60
#define CKM_DSA_PARAMETER_GEN		(0x2000)
Packit fd8b60
#define CKM_DH_PKCS_PARAMETER_GEN	(0x2001)
Packit fd8b60
#define CKM_X9_42_DH_PARAMETER_GEN	(0x2002)
Packit fd8b60
#define CKM_VENDOR_DEFINED		((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_mechanism
Packit fd8b60
{
Packit fd8b60
  ck_mechanism_type_t mechanism;
Packit fd8b60
  void *parameter;
Packit fd8b60
  unsigned long parameter_len;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_mechanism_info
Packit fd8b60
{
Packit fd8b60
  unsigned long min_key_size;
Packit fd8b60
  unsigned long max_key_size;
Packit fd8b60
  ck_flags_t flags;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
#define CKF_HW			(1 << 0)
Packit fd8b60
#define CKF_ENCRYPT		(1 << 8)
Packit fd8b60
#define CKF_DECRYPT		(1 << 9)
Packit fd8b60
#define CKF_DIGEST		(1 << 10)
Packit fd8b60
#define CKF_SIGN		(1 << 11)
Packit fd8b60
#define CKF_SIGN_RECOVER	(1 << 12)
Packit fd8b60
#define CKF_VERIFY		(1 << 13)
Packit fd8b60
#define CKF_VERIFY_RECOVER	(1 << 14)
Packit fd8b60
#define CKF_GENERATE		(1 << 15)
Packit fd8b60
#define CKF_GENERATE_KEY_PAIR	(1 << 16)
Packit fd8b60
#define CKF_WRAP		(1 << 17)
Packit fd8b60
#define CKF_UNWRAP		(1 << 18)
Packit fd8b60
#define CKF_DERIVE		(1 << 19)
Packit fd8b60
#define CKF_EXTENSION		((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
/* Flags for C_WaitForSlotEvent.  */
Packit fd8b60
#define CKF_DONT_BLOCK				(1)
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef unsigned long ck_rv_t;
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session,
Packit fd8b60
				ck_notification_t event, void *application);
Packit fd8b60
Packit fd8b60
/* Forward reference.  */
Packit fd8b60
struct ck_function_list;
Packit fd8b60
Packit fd8b60
#define _CK_DECLARE_FUNCTION(name, args)	\
Packit fd8b60
typedef ck_rv_t (*CK_ ## name) args;		\
Packit fd8b60
ck_rv_t CK_SPEC name args
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Initialize, (void *init_args));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Finalize, (void *reserved));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetFunctionList,
Packit fd8b60
		      (struct ck_function_list **function_list));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetSlotList,
Packit fd8b60
		      (unsigned char token_present, ck_slot_id_t *slot_list,
Packit fd8b60
		       unsigned long *count));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetSlotInfo,
Packit fd8b60
		      (ck_slot_id_t slot_id, struct ck_slot_info *info));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetTokenInfo,
Packit fd8b60
		      (ck_slot_id_t slot_id, struct ck_token_info *info));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_WaitForSlotEvent,
Packit fd8b60
		      (ck_flags_t flags, ck_slot_id_t *slot, void *reserved));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetMechanismList,
Packit fd8b60
		      (ck_slot_id_t slot_id,
Packit fd8b60
		       ck_mechanism_type_t *mechanism_list,
Packit fd8b60
		       unsigned long *count));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetMechanismInfo,
Packit fd8b60
		      (ck_slot_id_t slot_id, ck_mechanism_type_t type,
Packit fd8b60
		       struct ck_mechanism_info *info));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_InitToken,
Packit fd8b60
		      (ck_slot_id_t slot_id, unsigned char *pin,
Packit fd8b60
		       unsigned long pin_len, unsigned char *label));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_InitPIN,
Packit fd8b60
		      (ck_session_handle_t session, unsigned char *pin,
Packit fd8b60
		       unsigned long pin_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SetPIN,
Packit fd8b60
		      (ck_session_handle_t session, unsigned char *old_pin,
Packit fd8b60
		       unsigned long old_len, unsigned char *new_pin,
Packit fd8b60
		       unsigned long new_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_OpenSession,
Packit fd8b60
		      (ck_slot_id_t slot_id, ck_flags_t flags,
Packit fd8b60
		       void *application, ck_notify_t notify,
Packit fd8b60
		       ck_session_handle_t *session));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetSessionInfo,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_session_info *info));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetOperationState,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *operation_state,
Packit fd8b60
		       unsigned long *operation_state_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SetOperationState,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *operation_state,
Packit fd8b60
		       unsigned long operation_state_len,
Packit fd8b60
		       ck_object_handle_t encryption_key,
Packit fd8b60
		       ck_object_handle_t authentiation_key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Login,
Packit fd8b60
		      (ck_session_handle_t session, ck_user_type_t user_type,
Packit fd8b60
		       unsigned char *pin, unsigned long pin_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_CreateObject,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long count, ck_object_handle_t *object));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_CopyObject,
Packit fd8b60
		      (ck_session_handle_t session, ck_object_handle_t object,
Packit fd8b60
		       struct ck_attribute *templ, unsigned long count,
Packit fd8b60
		       ck_object_handle_t *new_object));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DestroyObject,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       ck_object_handle_t object));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetObjectSize,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       ck_object_handle_t object,
Packit fd8b60
		       unsigned long *size));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetAttributeValue,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       ck_object_handle_t object,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long count));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SetAttributeValue,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       ck_object_handle_t object,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long count));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_FindObjectsInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long count));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_FindObjects,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       ck_object_handle_t *object,
Packit fd8b60
		       unsigned long max_object_count,
Packit fd8b60
		       unsigned long *object_count));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_FindObjectsFinal,
Packit fd8b60
		      (ck_session_handle_t session));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_EncryptInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Encrypt,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *data, unsigned long data_len,
Packit fd8b60
		       unsigned char *encrypted_data,
Packit fd8b60
		       unsigned long *encrypted_data_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_EncryptUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *part, unsigned long part_len,
Packit fd8b60
		       unsigned char *encrypted_part,
Packit fd8b60
		       unsigned long *encrypted_part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_EncryptFinal,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *last_encrypted_part,
Packit fd8b60
		       unsigned long *last_encrypted_part_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DecryptInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Decrypt,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *encrypted_data,
Packit fd8b60
		       unsigned long encrypted_data_len,
Packit fd8b60
		       unsigned char *data, unsigned long *data_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DecryptUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *encrypted_part,
Packit fd8b60
		       unsigned long encrypted_part_len,
Packit fd8b60
		       unsigned char *part, unsigned long *part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DecryptFinal,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *last_part,
Packit fd8b60
		       unsigned long *last_part_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DigestInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Digest,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *data, unsigned long data_len,
Packit fd8b60
		       unsigned char *digest,
Packit fd8b60
		       unsigned long *digest_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DigestUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *part, unsigned long part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DigestKey,
Packit fd8b60
		      (ck_session_handle_t session, ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DigestFinal,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *digest,
Packit fd8b60
		       unsigned long *digest_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SignInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Sign,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *data, unsigned long data_len,
Packit fd8b60
		       unsigned char *signature,
Packit fd8b60
		       unsigned long *signature_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SignUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *part, unsigned long part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SignFinal,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *signature,
Packit fd8b60
		       unsigned long *signature_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SignRecoverInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SignRecover,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *data, unsigned long data_len,
Packit fd8b60
		       unsigned char *signature,
Packit fd8b60
		       unsigned long *signature_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_VerifyInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_Verify,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *data, unsigned long data_len,
Packit fd8b60
		       unsigned char *signature,
Packit fd8b60
		       unsigned long signature_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_VerifyUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *part, unsigned long part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_VerifyFinal,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *signature,
Packit fd8b60
		       unsigned long signature_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_VerifyRecoverInit,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_VerifyRecover,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *signature,
Packit fd8b60
		       unsigned long signature_len,
Packit fd8b60
		       unsigned char *data,
Packit fd8b60
		       unsigned long *data_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DigestEncryptUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *part, unsigned long part_len,
Packit fd8b60
		       unsigned char *encrypted_part,
Packit fd8b60
		       unsigned long *encrypted_part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DecryptDigestUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *encrypted_part,
Packit fd8b60
		       unsigned long encrypted_part_len,
Packit fd8b60
		       unsigned char *part,
Packit fd8b60
		       unsigned long *part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SignEncryptUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *part, unsigned long part_len,
Packit fd8b60
		       unsigned char *encrypted_part,
Packit fd8b60
		       unsigned long *encrypted_part_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *encrypted_part,
Packit fd8b60
		       unsigned long encrypted_part_len,
Packit fd8b60
		       unsigned char *part,
Packit fd8b60
		       unsigned long *part_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GenerateKey,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long count,
Packit fd8b60
		       ck_object_handle_t *key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GenerateKeyPair,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       struct ck_attribute *public_key_template,
Packit fd8b60
		       unsigned long public_key_attribute_count,
Packit fd8b60
		       struct ck_attribute *private_key_template,
Packit fd8b60
		       unsigned long private_key_attribute_count,
Packit fd8b60
		       ck_object_handle_t *public_key,
Packit fd8b60
		       ck_object_handle_t *private_key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_WrapKey,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t wrapping_key,
Packit fd8b60
		       ck_object_handle_t key,
Packit fd8b60
		       unsigned char *wrapped_key,
Packit fd8b60
		       unsigned long *wrapped_key_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_UnwrapKey,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t unwrapping_key,
Packit fd8b60
		       unsigned char *wrapped_key,
Packit fd8b60
		       unsigned long wrapped_key_len,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long attribute_count,
Packit fd8b60
		       ck_object_handle_t *key));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_DeriveKey,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       struct ck_mechanism *mechanism,
Packit fd8b60
		       ck_object_handle_t base_key,
Packit fd8b60
		       struct ck_attribute *templ,
Packit fd8b60
		       unsigned long attribute_count,
Packit fd8b60
		       ck_object_handle_t *key));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_SeedRandom,
Packit fd8b60
		      (ck_session_handle_t session, unsigned char *seed,
Packit fd8b60
		       unsigned long seed_len));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GenerateRandom,
Packit fd8b60
		      (ck_session_handle_t session,
Packit fd8b60
		       unsigned char *random_data,
Packit fd8b60
		       unsigned long random_len));
Packit fd8b60
Packit fd8b60
_CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session));
Packit fd8b60
_CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session));
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_function_list
Packit fd8b60
{
Packit fd8b60
  struct ck_version version;
Packit fd8b60
  CK_C_Initialize C_Initialize;
Packit fd8b60
  CK_C_Finalize C_Finalize;
Packit fd8b60
  CK_C_GetInfo C_GetInfo;
Packit fd8b60
  CK_C_GetFunctionList C_GetFunctionList;
Packit fd8b60
  CK_C_GetSlotList C_GetSlotList;
Packit fd8b60
  CK_C_GetSlotInfo C_GetSlotInfo;
Packit fd8b60
  CK_C_GetTokenInfo C_GetTokenInfo;
Packit fd8b60
  CK_C_GetMechanismList C_GetMechanismList;
Packit fd8b60
  CK_C_GetMechanismInfo C_GetMechanismInfo;
Packit fd8b60
  CK_C_InitToken C_InitToken;
Packit fd8b60
  CK_C_InitPIN C_InitPIN;
Packit fd8b60
  CK_C_SetPIN C_SetPIN;
Packit fd8b60
  CK_C_OpenSession C_OpenSession;
Packit fd8b60
  CK_C_CloseSession C_CloseSession;
Packit fd8b60
  CK_C_CloseAllSessions C_CloseAllSessions;
Packit fd8b60
  CK_C_GetSessionInfo C_GetSessionInfo;
Packit fd8b60
  CK_C_GetOperationState C_GetOperationState;
Packit fd8b60
  CK_C_SetOperationState C_SetOperationState;
Packit fd8b60
  CK_C_Login C_Login;
Packit fd8b60
  CK_C_Logout C_Logout;
Packit fd8b60
  CK_C_CreateObject C_CreateObject;
Packit fd8b60
  CK_C_CopyObject C_CopyObject;
Packit fd8b60
  CK_C_DestroyObject C_DestroyObject;
Packit fd8b60
  CK_C_GetObjectSize C_GetObjectSize;
Packit fd8b60
  CK_C_GetAttributeValue C_GetAttributeValue;
Packit fd8b60
  CK_C_SetAttributeValue C_SetAttributeValue;
Packit fd8b60
  CK_C_FindObjectsInit C_FindObjectsInit;
Packit fd8b60
  CK_C_FindObjects C_FindObjects;
Packit fd8b60
  CK_C_FindObjectsFinal C_FindObjectsFinal;
Packit fd8b60
  CK_C_EncryptInit C_EncryptInit;
Packit fd8b60
  CK_C_Encrypt C_Encrypt;
Packit fd8b60
  CK_C_EncryptUpdate C_EncryptUpdate;
Packit fd8b60
  CK_C_EncryptFinal C_EncryptFinal;
Packit fd8b60
  CK_C_DecryptInit C_DecryptInit;
Packit fd8b60
  CK_C_Decrypt C_Decrypt;
Packit fd8b60
  CK_C_DecryptUpdate C_DecryptUpdate;
Packit fd8b60
  CK_C_DecryptFinal C_DecryptFinal;
Packit fd8b60
  CK_C_DigestInit C_DigestInit;
Packit fd8b60
  CK_C_Digest C_Digest;
Packit fd8b60
  CK_C_DigestUpdate C_DigestUpdate;
Packit fd8b60
  CK_C_DigestKey C_DigestKey;
Packit fd8b60
  CK_C_DigestFinal C_DigestFinal;
Packit fd8b60
  CK_C_SignInit C_SignInit;
Packit fd8b60
  CK_C_Sign C_Sign;
Packit fd8b60
  CK_C_SignUpdate C_SignUpdate;
Packit fd8b60
  CK_C_SignFinal C_SignFinal;
Packit fd8b60
  CK_C_SignRecoverInit C_SignRecoverInit;
Packit fd8b60
  CK_C_SignRecover C_SignRecover;
Packit fd8b60
  CK_C_VerifyInit C_VerifyInit;
Packit fd8b60
  CK_C_Verify C_Verify;
Packit fd8b60
  CK_C_VerifyUpdate C_VerifyUpdate;
Packit fd8b60
  CK_C_VerifyFinal C_VerifyFinal;
Packit fd8b60
  CK_C_VerifyRecoverInit C_VerifyRecoverInit;
Packit fd8b60
  CK_C_VerifyRecover C_VerifyRecover;
Packit fd8b60
  CK_C_DigestEncryptUpdate C_DigestEncryptUpdate;
Packit fd8b60
  CK_C_DecryptDigestUpdate C_DecryptDigestUpdate;
Packit fd8b60
  CK_C_SignEncryptUpdate C_SignEncryptUpdate;
Packit fd8b60
  CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate;
Packit fd8b60
  CK_C_GenerateKey C_GenerateKey;
Packit fd8b60
  CK_C_GenerateKeyPair C_GenerateKeyPair;
Packit fd8b60
  CK_C_WrapKey C_WrapKey;
Packit fd8b60
  CK_C_UnwrapKey C_UnwrapKey;
Packit fd8b60
  CK_C_DeriveKey C_DeriveKey;
Packit fd8b60
  CK_C_SeedRandom C_SeedRandom;
Packit fd8b60
  CK_C_GenerateRandom C_GenerateRandom;
Packit fd8b60
  CK_C_GetFunctionStatus C_GetFunctionStatus;
Packit fd8b60
  CK_C_CancelFunction C_CancelFunction;
Packit fd8b60
  CK_C_WaitForSlotEvent C_WaitForSlotEvent;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
typedef ck_rv_t (*ck_createmutex_t) (void **mutex);
Packit fd8b60
typedef ck_rv_t (*ck_destroymutex_t) (void *mutex);
Packit fd8b60
typedef ck_rv_t (*ck_lockmutex_t) (void *mutex);
Packit fd8b60
typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex);
Packit fd8b60
Packit fd8b60
Packit fd8b60
struct ck_c_initialize_args
Packit fd8b60
{
Packit fd8b60
  ck_createmutex_t create_mutex;
Packit fd8b60
  ck_destroymutex_t destroy_mutex;
Packit fd8b60
  ck_lockmutex_t lock_mutex;
Packit fd8b60
  ck_unlockmutex_t unlock_mutex;
Packit fd8b60
  ck_flags_t flags;
Packit fd8b60
  void *reserved;
Packit fd8b60
};
Packit fd8b60
Packit fd8b60
Packit fd8b60
#define CKF_LIBRARY_CANT_CREATE_OS_THREADS	(1 << 0)
Packit fd8b60
#define CKF_OS_LOCKING_OK			(1 << 1)
Packit fd8b60
Packit fd8b60
#define CKR_OK					(0)
Packit fd8b60
#define CKR_CANCEL				(1)
Packit fd8b60
#define CKR_HOST_MEMORY				(2)
Packit fd8b60
#define CKR_SLOT_ID_INVALID			(3)
Packit fd8b60
#define CKR_GENERAL_ERROR			(5)
Packit fd8b60
#define CKR_FUNCTION_FAILED			(6)
Packit fd8b60
#define CKR_ARGUMENTS_BAD			(7)
Packit fd8b60
#define CKR_NO_EVENT				(8)
Packit fd8b60
#define CKR_NEED_TO_CREATE_THREADS		(9)
Packit fd8b60
#define CKR_CANT_LOCK				(0xa)
Packit fd8b60
#define CKR_ATTRIBUTE_READ_ONLY			(0x10)
Packit fd8b60
#define CKR_ATTRIBUTE_SENSITIVE			(0x11)
Packit fd8b60
#define CKR_ATTRIBUTE_TYPE_INVALID		(0x12)
Packit fd8b60
#define CKR_ATTRIBUTE_VALUE_INVALID		(0x13)
Packit fd8b60
#define CKR_DATA_INVALID			(0x20)
Packit fd8b60
#define CKR_DATA_LEN_RANGE			(0x21)
Packit fd8b60
#define CKR_DEVICE_ERROR			(0x30)
Packit fd8b60
#define CKR_DEVICE_MEMORY			(0x31)
Packit fd8b60
#define CKR_DEVICE_REMOVED			(0x32)
Packit fd8b60
#define CKR_ENCRYPTED_DATA_INVALID		(0x40)
Packit fd8b60
#define CKR_ENCRYPTED_DATA_LEN_RANGE		(0x41)
Packit fd8b60
#define CKR_FUNCTION_CANCELED			(0x50)
Packit fd8b60
#define CKR_FUNCTION_NOT_PARALLEL		(0x51)
Packit fd8b60
#define CKR_FUNCTION_NOT_SUPPORTED		(0x54)
Packit fd8b60
#define CKR_KEY_HANDLE_INVALID			(0x60)
Packit fd8b60
#define CKR_KEY_SIZE_RANGE			(0x62)
Packit fd8b60
#define CKR_KEY_TYPE_INCONSISTENT		(0x63)
Packit fd8b60
#define CKR_KEY_NOT_NEEDED			(0x64)
Packit fd8b60
#define CKR_KEY_CHANGED				(0x65)
Packit fd8b60
#define CKR_KEY_NEEDED				(0x66)
Packit fd8b60
#define CKR_KEY_INDIGESTIBLE			(0x67)
Packit fd8b60
#define CKR_KEY_FUNCTION_NOT_PERMITTED		(0x68)
Packit fd8b60
#define CKR_KEY_NOT_WRAPPABLE			(0x69)
Packit fd8b60
#define CKR_KEY_UNEXTRACTABLE			(0x6a)
Packit fd8b60
#define CKR_MECHANISM_INVALID			(0x70)
Packit fd8b60
#define CKR_MECHANISM_PARAM_INVALID		(0x71)
Packit fd8b60
#define CKR_OBJECT_HANDLE_INVALID		(0x82)
Packit fd8b60
#define CKR_OPERATION_ACTIVE			(0x90)
Packit fd8b60
#define CKR_OPERATION_NOT_INITIALIZED		(0x91)
Packit fd8b60
#define CKR_PIN_INCORRECT			(0xa0)
Packit fd8b60
#define CKR_PIN_INVALID				(0xa1)
Packit fd8b60
#define CKR_PIN_LEN_RANGE			(0xa2)
Packit fd8b60
#define CKR_PIN_EXPIRED				(0xa3)
Packit fd8b60
#define CKR_PIN_LOCKED				(0xa4)
Packit fd8b60
#define CKR_SESSION_CLOSED			(0xb0)
Packit fd8b60
#define CKR_SESSION_COUNT			(0xb1)
Packit fd8b60
#define CKR_SESSION_HANDLE_INVALID		(0xb3)
Packit fd8b60
#define CKR_SESSION_PARALLEL_NOT_SUPPORTED	(0xb4)
Packit fd8b60
#define CKR_SESSION_READ_ONLY			(0xb5)
Packit fd8b60
#define CKR_SESSION_EXISTS			(0xb6)
Packit fd8b60
#define CKR_SESSION_READ_ONLY_EXISTS		(0xb7)
Packit fd8b60
#define CKR_SESSION_READ_WRITE_SO_EXISTS	(0xb8)
Packit fd8b60
#define CKR_SIGNATURE_INVALID			(0xc0)
Packit fd8b60
#define CKR_SIGNATURE_LEN_RANGE			(0xc1)
Packit fd8b60
#define CKR_TEMPLATE_INCOMPLETE			(0xd0)
Packit fd8b60
#define CKR_TEMPLATE_INCONSISTENT		(0xd1)
Packit fd8b60
#define CKR_TOKEN_NOT_PRESENT			(0xe0)
Packit fd8b60
#define CKR_TOKEN_NOT_RECOGNIZED		(0xe1)
Packit fd8b60
#define CKR_TOKEN_WRITE_PROTECTED		(0xe2)
Packit fd8b60
#define	CKR_UNWRAPPING_KEY_HANDLE_INVALID	(0xf0)
Packit fd8b60
#define CKR_UNWRAPPING_KEY_SIZE_RANGE		(0xf1)
Packit fd8b60
#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT	(0xf2)
Packit fd8b60
#define CKR_USER_ALREADY_LOGGED_IN		(0x100)
Packit fd8b60
#define CKR_USER_NOT_LOGGED_IN			(0x101)
Packit fd8b60
#define CKR_USER_PIN_NOT_INITIALIZED		(0x102)
Packit fd8b60
#define CKR_USER_TYPE_INVALID			(0x103)
Packit fd8b60
#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN	(0x104)
Packit fd8b60
#define CKR_USER_TOO_MANY_TYPES			(0x105)
Packit fd8b60
#define CKR_WRAPPED_KEY_INVALID			(0x110)
Packit fd8b60
#define CKR_WRAPPED_KEY_LEN_RANGE		(0x112)
Packit fd8b60
#define CKR_WRAPPING_KEY_HANDLE_INVALID		(0x113)
Packit fd8b60
#define CKR_WRAPPING_KEY_SIZE_RANGE		(0x114)
Packit fd8b60
#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT	(0x115)
Packit fd8b60
#define CKR_RANDOM_SEED_NOT_SUPPORTED		(0x120)
Packit fd8b60
#define CKR_RANDOM_NO_RNG			(0x121)
Packit fd8b60
#define CKR_DOMAIN_PARAMS_INVALID		(0x130)
Packit fd8b60
#define CKR_BUFFER_TOO_SMALL			(0x150)
Packit fd8b60
#define CKR_SAVED_STATE_INVALID			(0x160)
Packit fd8b60
#define CKR_INFORMATION_SENSITIVE		(0x170)
Packit fd8b60
#define CKR_STATE_UNSAVEABLE			(0x180)
Packit fd8b60
#define CKR_CRYPTOKI_NOT_INITIALIZED		(0x190)
Packit fd8b60
#define CKR_CRYPTOKI_ALREADY_INITIALIZED	(0x191)
Packit fd8b60
#define CKR_MUTEX_BAD				(0x1a0)
Packit fd8b60
#define CKR_MUTEX_NOT_LOCKED			(0x1a1)
Packit fd8b60
#define CKR_FUNCTION_REJECTED			(0x200)
Packit fd8b60
#define CKR_VENDOR_DEFINED			((unsigned long) (1 << 31))
Packit fd8b60
Packit fd8b60
Packit fd8b60
/* Compatibility layer.  */
Packit fd8b60
Packit fd8b60
#ifdef CRYPTOKI_COMPAT
Packit fd8b60
Packit fd8b60
#undef CK_DEFINE_FUNCTION
Packit fd8b60
#define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name
Packit fd8b60
Packit fd8b60
/* For NULL.  */
Packit fd8b60
#include <stddef.h>
Packit fd8b60
Packit fd8b60
typedef unsigned char CK_BYTE;
Packit fd8b60
typedef unsigned char CK_CHAR;
Packit fd8b60
typedef unsigned char CK_UTF8CHAR;
Packit fd8b60
typedef unsigned char CK_BBOOL;
Packit fd8b60
typedef unsigned long int CK_ULONG;
Packit fd8b60
typedef long int CK_LONG;
Packit fd8b60
typedef CK_BYTE *CK_BYTE_PTR;
Packit fd8b60
typedef CK_CHAR *CK_CHAR_PTR;
Packit fd8b60
typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR;
Packit fd8b60
typedef CK_ULONG *CK_ULONG_PTR;
Packit fd8b60
typedef void *CK_VOID_PTR;
Packit fd8b60
typedef void **CK_VOID_PTR_PTR;
Packit fd8b60
#define CK_FALSE 0
Packit fd8b60
#define CK_TRUE 1
Packit fd8b60
#ifndef CK_DISABLE_TRUE_FALSE
Packit fd8b60
#ifndef FALSE
Packit fd8b60
#define FALSE 0
Packit fd8b60
#endif
Packit fd8b60
#ifndef TRUE
Packit fd8b60
#define TRUE 1
Packit fd8b60
#endif
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
typedef struct ck_version CK_VERSION;
Packit fd8b60
typedef struct ck_version *CK_VERSION_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_info CK_INFO;
Packit fd8b60
typedef struct ck_info *CK_INFO_PTR;
Packit fd8b60
Packit fd8b60
typedef ck_slot_id_t *CK_SLOT_ID_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_slot_info CK_SLOT_INFO;
Packit fd8b60
typedef struct ck_slot_info *CK_SLOT_INFO_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_token_info CK_TOKEN_INFO;
Packit fd8b60
typedef struct ck_token_info *CK_TOKEN_INFO_PTR;
Packit fd8b60
Packit fd8b60
typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_session_info CK_SESSION_INFO;
Packit fd8b60
typedef struct ck_session_info *CK_SESSION_INFO_PTR;
Packit fd8b60
Packit fd8b60
typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR;
Packit fd8b60
Packit fd8b60
typedef ck_object_class_t *CK_OBJECT_CLASS_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_attribute CK_ATTRIBUTE;
Packit fd8b60
typedef struct ck_attribute *CK_ATTRIBUTE_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_date CK_DATE;
Packit fd8b60
typedef struct ck_date *CK_DATE_PTR;
Packit fd8b60
Packit fd8b60
typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_mechanism CK_MECHANISM;
Packit fd8b60
typedef struct ck_mechanism *CK_MECHANISM_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_mechanism_info CK_MECHANISM_INFO;
Packit fd8b60
typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_function_list CK_FUNCTION_LIST;
Packit fd8b60
typedef struct ck_function_list *CK_FUNCTION_LIST_PTR;
Packit fd8b60
typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR;
Packit fd8b60
Packit fd8b60
typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS;
Packit fd8b60
typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR;
Packit fd8b60
Packit fd8b60
#define NULL_PTR NULL
Packit fd8b60
Packit fd8b60
/* Delete the helper macros defined at the top of the file.  */
Packit fd8b60
#undef ck_flags_t
Packit fd8b60
#undef ck_version
Packit fd8b60
Packit fd8b60
#undef ck_info
Packit fd8b60
#undef cryptoki_version
Packit fd8b60
#undef manufacturer_id
Packit fd8b60
#undef library_description
Packit fd8b60
#undef library_version
Packit fd8b60
Packit fd8b60
#undef ck_notification_t
Packit fd8b60
#undef ck_slot_id_t
Packit fd8b60
Packit fd8b60
#undef ck_slot_info
Packit fd8b60
#undef slot_description
Packit fd8b60
#undef hardware_version
Packit fd8b60
#undef firmware_version
Packit fd8b60
Packit fd8b60
#undef ck_token_info
Packit fd8b60
#undef serial_number
Packit fd8b60
#undef max_session_count
Packit fd8b60
#undef session_count
Packit fd8b60
#undef max_rw_session_count
Packit fd8b60
#undef rw_session_count
Packit fd8b60
#undef max_pin_len
Packit fd8b60
#undef min_pin_len
Packit fd8b60
#undef total_public_memory
Packit fd8b60
#undef free_public_memory
Packit fd8b60
#undef total_private_memory
Packit fd8b60
#undef free_private_memory
Packit fd8b60
#undef utc_time
Packit fd8b60
Packit fd8b60
#undef ck_session_handle_t
Packit fd8b60
#undef ck_user_type_t
Packit fd8b60
#undef ck_state_t
Packit fd8b60
Packit fd8b60
#undef ck_session_info
Packit fd8b60
#undef slot_id
Packit fd8b60
#undef device_error
Packit fd8b60
Packit fd8b60
#undef ck_object_handle_t
Packit fd8b60
#undef ck_object_class_t
Packit fd8b60
#undef ck_hw_feature_type_t
Packit fd8b60
#undef ck_key_type_t
Packit fd8b60
#undef ck_certificate_type_t
Packit fd8b60
#undef ck_attribute_type_t
Packit fd8b60
Packit fd8b60
#undef ck_attribute
Packit fd8b60
#undef value
Packit fd8b60
#undef value_len
Packit fd8b60
Packit fd8b60
#undef ck_date
Packit fd8b60
Packit fd8b60
#undef ck_mechanism_type_t
Packit fd8b60
Packit fd8b60
#undef ck_mechanism
Packit fd8b60
#undef parameter
Packit fd8b60
#undef parameter_len
Packit fd8b60
Packit fd8b60
#undef ck_mechanism_info
Packit fd8b60
#undef min_key_size
Packit fd8b60
#undef max_key_size
Packit fd8b60
Packit fd8b60
#undef ck_rv_t
Packit fd8b60
#undef ck_notify_t
Packit fd8b60
Packit fd8b60
#undef ck_function_list
Packit fd8b60
Packit fd8b60
#undef ck_createmutex_t
Packit fd8b60
#undef ck_destroymutex_t
Packit fd8b60
#undef ck_lockmutex_t
Packit fd8b60
#undef ck_unlockmutex_t
Packit fd8b60
Packit fd8b60
#undef ck_c_initialize_args
Packit fd8b60
#undef create_mutex
Packit fd8b60
#undef destroy_mutex
Packit fd8b60
#undef lock_mutex
Packit fd8b60
#undef unlock_mutex
Packit fd8b60
#undef reserved
Packit fd8b60
Packit fd8b60
#endif	/* CRYPTOKI_COMPAT */
Packit fd8b60
Packit fd8b60
/* System dependencies.  */
Packit fd8b60
#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32)
Packit fd8b60
#pragma pack(pop, cryptoki)
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
#if defined(__cplusplus)
Packit fd8b60
}
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
#endif	/* PKCS11_H */