typedef uint32 CSSM_BOOL;
#define CSSM_TRUE 1
#define CSSM_FALSE 0
typedef enum cssm_return {
CSSM_OK = 0,
CSSM_FAIL = -1
} CSSM_RETURN
#define CSSM_MODULE_STRING_SIZE 64
typedef char CSSM_STRING [CSSM_MODULE_STRING_SIZE + 4];
typedef struct cssm_data{
uint32 Length; /* in bytes */
uint8 *Data;
} CSSM_DATA, *CSSM_DATA_PTR
typedef struct cssm_guid{
uint32 Data1;
uint16 Data2;
uint16 Data3;
uint8 Data4[8];
} CSSM_GUID, *CSSM_GUID_PTR
typedef struct cssm_version {
uint32 Major;
uint32 Minor;
} CSSM_VERSION, *CSSM_VERSION_PTR;
typedef struct cssm_subservice_uid {
CSSM_GUID Guid;
CSSM_VERSION Version;
uint32 SubserviceId;
uint32 SubserviceFlags;
} CSSM_SUBSERVICE_UID, *CSSM_SUBSERVICE_UID_PTR;
typedef uint32 CSSM_HANDLE, *CSSM_HANDLE_PTR
typedef uint32 CSSM_MODULE_HANDLE
typedef uint32 CSSM_EVENT_TYPE, *CSSM_EVENT_TYPE_PTR;
#define CSSM_EVENT_ATTACH (0)
/* application has requested an attach operation */
#define CSSM_EVENT_DETACH (1)
/* application has requested an detach operation */
#define CSSM_EVENT_INFOATTACH (2)
/* application has requested module info for dynamic module
capabilities */
#define CSSM_EVENT_INFODETACH (3)
/* CSSM has completed obtaining dynamic module
capabilities */
#define CSSM_EVENT_CREATE_CONTEXT (4)
/* application has performed a create context operation */
#define CSSM_EVENT_DELETE_CONTEXT (5)
/* application has performed a delete context operation */
typedef uint32 CSSM_SERVICE_MASK;
#define CSSM_SERVICE_CSSM 0x1
#define CSSM_SERVICE_CSP 0x2
#define CSSM_SERVICE_DL 0x4
#define CSSM_SERVICE_CL 0x8
#define CSSM_SERVICE_TP 0x10
#define CSSM_SERVICE_LAST CSSM_SERVICE_TP
typedef CSSM_SERVICE_MASK CSSM_SERVICE_TYPE
typedef uint32 CSSM_SERVICE_FLAGS
#define CSSM_SERVICE_ISWRAPPEDPRODUCT 0x1
/* On = Contains one or more embedded products
Off = Contains no embedded products */
typedef struct cssm_serviceinfo {
CSSM_STRING Description; /* Service description */
CSSM_SERVICE_TYPE Type; /* Service type */
CSSM_SERVICE_FLAGS Flags; /* Service flags */
uint32 NumberOfSubServices; /* Number of sub services in SubService List */
union cssm_subservice_list { /* list of sub services */
void *SubServiceList;
CSSM_CSPSUBSERVICE_PTR CspSubServiceList;
CSSM_DLSUBSERVICE_PTR DlSubServiceList;
CSSM_CLSUBSERVICE_PTR ClSubServiceList;
CSSM_TPSUBSERVICE_PTR TpSubServiceList;
} SubserviceList ;
void *Reserved;
} CSSM_SERVICE_INFO, *CSSM_SERVICE_INFO_PTR;
typedef uint32 CSSM_MODULE_FLAGS;
#define CSSM_MODULE_THREADSAFE 0x1
/* Module is threadsafe */
#define CSSM_MODULE_EXPORTABLE 0x2
/* Module can be exported outside the USA */
#define CSSM_MODULE_CALLER_AUTHENTOCSSM 0x04
/* CSSM authenticates the caller based */
/* on CSSM-known points of trust */
#define CSSM_MODULE_CALLER_AUTHENTOMODULE 0x08
/* CSSM authenticates the caller based */
/* on module-supplied points of trust */
typedef struct cssm_moduleinfo {
CSSM_VERSION Version; /* Module version */
CSSM_VERSION CompatibleCSSMVersion; /* CSSM version the
module is written for*/
CSSM_STRING Description; /* Module description */
CSSM_STRING Vendor; /* Vendor name */
CSSM_STRING ModuleFileName, /* File name for module
object code */
CSSM_STRING ModulePathName, /* Path name to module
object code */
CSSM_MODULE_FLAGS Flags; /* Flags to describe and
control module use */
CSSM_KEY_PTR AppAuthenRootKeys, /* Module-specific keys to
authen apps */
uint32 NumberOfAppAuthenRootKeys, /* Number of module-
specific root keys */
CSSM_SERVICE_MASK ServiceMask; /* Bit mask of supported
services */
uint32 NumberOfServices; /* Number of services
in ServiceList */
CSSM_SERVICE_INFO_PTR ServiceList; /* A list of service
info structures */
void *Reserved;
} CSSM_MODULE_INFO, *CSSM_MODULE_INFO_PTR;
#define CSSM_ALL_SUBSERVICES (0xFFFFFFFF)
typedef enum cssm_info_level {
CSSM_INFO_LEVEL_MODULE = 0,
/* values from CSSM_SERVICE_INFO struct */
CSSM_INFO_LEVEL_SUBSERVICE = 1,
/* values from CSSM_SERVICE_INFO and XXsubservice struct */
CSSM_INFO_LEVEL_STATIC_ATTR = 2,
/* values from CSSM_SERVICE_INFO and XXsubservice and
all static-valued attributes of a subservice */
CSSM_INFO_LEVEL_ALL_ATTR = 3,
/* values from CSSM_SERVICE_INFO and XXsubservice and
all attributes, static and dynamic, of a subservice */
} CSSM_INFO_LEVEL;
typedef enum cssm_net_address_type {
CSSM_ADDR_NONE = 0,
CSSM_ADDR_CUSTOM = 1,
CSSM_ADDR_URL = 2, /* char* */
CSSM_ADDR_SOCKADDR = 3,
CSSM_ADDR_NAME = 4 /* char* - qualified by access method */
} CSSM_NET_ADDRESS_TYPE;
typedef struct cssm_net_address {
CSSM_NET_ADDRESS_TYPE AddressType;
CSSM_DATA Address;
} CSSM_NET_ADDRESS, *CSSM_NET_ADDRESS_PTR;
typedef enum cssm_net_protocol {
CSSM_NET_PROTO_NONE = 0, /* local */
CSSM_NET_PROTO_CUSTOM = 1, /* proprietary implementation */
CSSM_NET_PROTO_UNSPECIFIED = 2, /* implementation default */
CSSM_NET_PROTO_LDAP = 3, /* light weight directory access
protocol */
CSSM_NET_PROTO_LDAPS = 4, /* ldap/ssl where SSL initiates
the connection */
CSSM_NET_PROTO_LDAPNS = 5, /* ldap where ldap negotiates an
SSL session */
CSSM_NET_PROTO_X500DAP = 6, /* x.500 Directory access
protocol */
CSSM_NET_PROTO_FTPDAP = 7, /* file transfer protocol for
cert/crl fetch */
CSSM_NET_PROTO_FTPDAPS = 8, /* ftp/ssl where SSL initiates
the connection */
CSSM_NET_PROTO_NDS = 9, /* Novell directory services */
CSSM_NET_PROTO_OCSP = 10, /* online certificate status
protocol */
CSSM_NET_PROTO_PKIX3 = 11, /* the cert request protocol
in PKIX3 */
CSSM_NET_PROTO_PKIX3S = 12, /* The ssl/tls derivative of
PKIX3 */
CSSM_NET_PROTO_PKCS_HTTP = 13, /* PKCS client <=> CA protocol
over HTTP */
CSSM_NET_PROTO_PKCS_HTTPS = 14, /* PKCS client <=> CA protocol
over HTTPS */
} CSSM_NET_PROTOCOL;
typedef enum cssm_user_authentication_mechanism {
CSSM_AUTHENTICATION_NONE = 0,
CSSM_AUTHENTICATION_CUSTOM = 1,
CSSM_AUTHENTICATION_PASSWORD = 2,
CSSM_AUTHENTICATION_USERID_AND_PASSWORD = 3,
CSSM_AUTHENTICATION_CERTIFICATE_AND_PASSPHRASE = 4,
CSSM_AUTHENTICATION_LOGIN_AND_WRAP = 5,
} CSSM_USER_AUTHENTICATION_MECHANISM;
typedef CSSM_DATA_PTR (CSSMAPI *CSSM_CALLBACK) (void *allocRef, uint32 ID);
typedef struct cssm_crypto_data {
CSSM_DATA_PTR Param;
CSSM_CALLBACK Callback;
uint32 ID;
}CSSM_CRYPTO_DATA, *CSSM_CRYPTO_DATA_PTR
This structure holds the user's credentials for authenticating to a module. The type of credentials required is defined by the module and specified as a CSSM_USER_AUTHENTICATION_MECHANISM.
typedef struct cssm_user_authentication {
CSSM_DATA_PTR Credential; /* a cert, a shared secret, other */
CSSM_CRYPTO_DATA_PTR MoreAuthenticationData;
} CSSM_USER_AUTHENTICATION, *CSSM_USER_AUTHENTICATION_PTR;
typedef CSSM_RETURN (CSSMAPI *CSSM_NOTIFY_CALLBACK)
(CSSM_CSP_HANDLE ModuleHandle,
uint32 Application,
uint32 Reason,
uint32 Param);
Reason | Description |
---|---|
CSSM_NOTIFY_SURRENDER | The add-in module is temporarily surrendering control of the process |
CSSM_NOTIFY_COMPLETE | An asynchronous operation has completed |
CSSM_NOTIFY_DEVICE_REMOVED | A device, such as a token, has been removed |
CSSM_NOTIFY_DEVICE_INSERTED | A device, such as a token, has been inserted |
typedef struct cssm_memory_funcs {
void *(*malloc_func) (uint32 Size, void *AllocRef);
void (*free_func) (void *MemPtr, void *AllocRef);
void *(*realloc_func)(void *MemPtr, uint32 Size, void *AllocRef);
void *(*calloc_func) (uint32 Num, uint32 Size, void *AllocRef);
void *AllocRef;
} CSSM_MEMORY_FUNCS, *CSSM_MEMORY_FUNCS_PTR;
typedef CSSM_MEMORY_FUNCS CSSM_API_MEMORY_FUNCS;
typedef CSSM_API_MEMORY_FUNCS *CSSM_API_MEMORY_FUNCS_PTR;
typedef struct cssm_spi_memory_funcs {
void *(*malloc_func) (CSSM_HANDLE AddInHandle, uint32 Size);
void (*free_func) (CSSM_HANDLE AddInHandle, void *MemPtr);
void *(*realloc_func)(CSSM_HANDLE AddInHandle, void *MemPtr,
uint32 Size);
void *(*calloc_func) (CSSM_HANDLE AddInHandle, uint32 Num,
uint32 Size);
} CSSM_SPI_MEMORY_FUNCS, *CSSM_SPI_MEMORY_FUNCS_PTR;
typedef struct cssm_module_funcs {
CSSM_SERVICE_TYPE ServiceType;
union cssm_function_table {
void *ServiceFuncs;
CSSM_SPI_CSP_FUNCS_PTR CspFuncs;
CSSM_SPI_DL_FUNCS_PTR DlFuncs;
CSSM_SPI_CL_FUNCS_PTR ClFuncs;
CSSM_SPI_TP_FUNCS_PTR TpFuncs;
} FunctionTable;
} CSSM_MODULE_FUNCS, *CSSM_MODULE_FUNCS_PTR;
Value | Description |
---|---|
CSSM_SPI_CSP_FUNCS_PTR CspFuncs | Functions pointers to CSP services. |
CSSM_SPI_DL_FUNCS_PTR DlFuncs | Functions pointers to DL services. |
CSSM_SPI_CL_FUNCS_PTR ClFuncs | Functions pointers to CL services. |
CSSM_SPI_TP_FUNCS_PTR TpFuncs | Functions pointers to TP services. |
typedef struct cssm_handleinfo {
uint32 SubServiceID;
uint32 SessionFlags;
CSSM_NOTIFY_CALLBACK Callback;
uint32 ApplicationContext;
} CSSM_HANDLEINFO, *CSSM_HANDLEINFO_PTR;
typedef struct cssm_registration_info {
/* Loading, Unloading and Event Notifications */
CSSM_RETURN (CSSMAPI *Initialize) (CSSM_MODULE_HANDLE Handle,
uint32 VerMajor,
uint32 VerMinor);
CSSM_RETURN (CSSMAPI *Terminate) (CSSM_MODULE_HANDLE Handle);
CSSM_RETURN (CSSMAPI *EventNotify)(CSSM_MODULE_HANDLE Handle,
const CSSM_EVENT_TYPE Event,
const uint32 Param);
CSSM_MODULE_INFO_PTR (CSSMAPI *GetModuleInfo)
(CSSM_MODULE_HANDLE ModuleHandle,
CSSM_SERVICE_MASK ServiceMask,
uint32 SubserviceID,
CSSM_INFO_LEVEL InfoLevel);
CSSM_RETURN (CSSMAPI *FreeModuleInfo)
(CSSM_MODULE_HANDLE ModuleHandle,
CSSM_MODULE_INFO_PTR ModuleInfo);
CSSM_BOOL ThreadSafe;
uint32 ServiceSummary;
uint32 NumberOfServiceTables;
CSSM_MODULE_FUNCS_PTR Services;
} CSSM_REGISTRATION_INFO, *CSSM_REGISTRATION_INFO_PTR;
The manpages for Function Definitions can be found at the end of this chapter.
Contents | Next section | Index |