cssmapi.h

来自「Next BIOS Source code : Extensible Firmw」· C头文件 代码 · 共 660 行 · 第 1/3 页

H
660
字号
/* SCCSID: inc/cssmapi.h, dss_cdsa_fwk, fwk_rel2, dss_971010 1.21 10/23/97 17:53:31 */
/*-----------------------------------------------------------------------
 *      File:   CSSMAPI.H
 *
Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.

 *-----------------------------------------------------------------------
 */
/* 
 * WARNING: EXPORT RESTRICTED. 
 * This software is subject to the U.S. Export Administration Regulations 
 * and other U.S. law, and may not be exported or re-exported to certain 
 * countries (currently Afghanistan (Taliban-controlled areas), Cuba, Iran, 
 * Iraq, Libya, North Korea, Serbia (except Kosovo), Sudan and Syria) or to 
 * persons or entities prohibited from receiving U.S. exports (including Denied 
 * Parties, Specially Designated Nationals, and entities on the Bureau of 
 * Export Administration Entity List or involved with missile technology or 
 * nuclear, chemical or biological weapons).
 */ 
/*
 * (C) COPYRIGHT International Business Machines Corp. 1996, 1997
 * All Rights Reserved
 * Licensed Materials - Property of IBM
 *
Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.

 *
 * US Government Users Restricted Rights - Use, duplication or
 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 *
 */

#ifndef _CSSMAPI_H
#define _CSSMAPI_H    

#include "cssmdefs.h"

/* API Functions */
#ifdef __cplusplus
extern "C" {
#endif

/* CSSM functions */
/*
 * Core Functions.
 */
CSSM_RETURN       CSSMAPI CSSM_Init (
                                const CSSM_VERSION_PTR Version,
                                const void * Reserved);

CSSM_CSSMINFO_PTR CSSMAPI CSSM_GetInfo (
                                const CSSM_MEMORY_FUNCS_PTR MemoryFunctions,
                                uint32 *NumCssmInfos); 

CSSM_RETURN       CSSMAPI CSSM_FreeInfo (  
                                const CSSM_CSSMINFO_PTR CssmInfo,
                                const CSSM_MEMORY_FUNCS_PTR MemoryFunctions,
                                uint32 NumCssmInfos);

/* Module Management functions */
CSSM_MODULE_HANDLE   CSSMAPI CSSM_ModuleAttach (
                                const CSSM_GUID_PTR GUID,
                                const CSSM_VERSION_PTR Version,
                                const CSSM_API_MEMORY_FUNCS_PTR MemoryFuncs,
                                uint32 SubserviceID,
                                uint32 SubserviceFlags,
                                uint32 Application,
                                const CSSM_NOTIFY_CALLBACK Notification, 
                                const char *AppFileName,
                                const char *AppPathName,
                                const void * Reserved);

CSSM_RETURN          CSSMAPI CSSM_ModuleDetach (
                                CSSM_MODULE_HANDLE ModuleHandle);

CSSM_LIST_PTR        CSSMAPI CSSM_ListModules (
                                CSSM_SERVICE_MASK ServiceMask,
                                CSSM_BOOL MatchAll);

CSSM_RETURN          CSSMAPI CSSM_FreeList (CSSM_LIST_PTR List);

CSSM_MODULE_INFO_PTR CSSMAPI CSSM_GetModuleInfo (
                                const CSSM_GUID_PTR ModuleGUID,
                                CSSM_SERVICE_MASK ServiceMask,
                                uint32 SubserviceID,
                                CSSM_INFO_LEVEL InfoLevel);

CSSM_RETURN          CSSMAPI CSSM_FreeModuleInfo (
                                CSSM_MODULE_INFO_PTR ModuleInfo);

/* Error Handling */
CSSM_ERROR_PTR CSSMAPI CSSM_GetError  (void);  

CSSM_RETURN    CSSMAPI CSSM_SetError  (CSSM_GUID_PTR guid, 
                                       uint32  error);
void           CSSMAPI CSSM_ClearError(void);          

/* Utility Functions */
void        CSSMAPI CSSM_Free         (void *MemPtr, 
                                       CSSM_HANDLE AddInHandle);
CSSM_RETURN CSSMAPI CSSM_GetAPIMemoryFunctions (
                                       CSSM_HANDLE AddInHandle,
                                       CSSM_API_MEMORY_FUNCS_PTR AppMemoryFuncs);
CSSM_BOOL   CSSMAPI CSSM_CompareGuids (CSSM_GUID guid1,CSSM_GUID guid2);


/* Cryptographic Context API */
CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateSignatureContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       uint32 AlgorithmID,
                                       const CSSM_CRYPTO_DATA_PTR PassPhrase,
                                       const CSSM_KEY_PTR Key);

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateSymmetricContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       uint32 AlgorithmID,
                                       uint32 Mode,
                                       const CSSM_KEY_PTR Key,
                                       const CSSM_DATA_PTR InitVector, 
                                       uint32 Padding,
                                       uint32 Params);

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateDigestContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       uint32 AlgorithmID);

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateRandomGenContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       uint32 AlgorithmID,
                                       const CSSM_CRYPTO_DATA_PTR Seed,
                                       uint32 Length);

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateAsymmetricContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       uint32 AlgorithmID,
                                       const CSSM_CRYPTO_DATA_PTR PassPhrase,
                                       const CSSM_KEY_PTR Key,
                                       uint32 Padding);

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateKeyGenContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       uint32 AlgorithmID,
                                       const CSSM_CRYPTO_DATA_PTR PassPhrase,
                                       uint32 KeySizeInBits,
                                       const CSSM_CRYPTO_DATA_PTR Seed,
                                       const CSSM_DATA_PTR Salt,
                                       const CSSM_DATE_PTR StartDate,
                                       const CSSM_DATE_PTR EndDate,
                                       const CSSM_DATA_PTR Params);

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreatePassThroughContext (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       const CSSM_KEY_PTR Key,
                                       const CSSM_DATA_PTR ParamBufs,
                                       uint32 ParamBufCount);

CSSM_RETURN CSSMAPI CSSM_DeleteContext(CSSM_CC_HANDLE CCHandle);


/*
 * Cryptographic Sessions and Logon API
 */
CSSM_RETURN CSSMAPI CSSM_CSP_Login    (CSSM_CSP_HANDLE CSPHandle,
                                       const CSSM_CRYPTO_DATA_PTR Password,
                                       const CSSM_DATA_PTR pReserved);

CSSM_RETURN CSSMAPI CSSM_CSP_Logout   (CSSM_CSP_HANDLE CSPHandle);

CSSM_RETURN CSSMAPI CSSM_CSP_ChangeLoginPassword (
                                       CSSM_CSP_HANDLE CSPHandle,
                                       const CSSM_CRYPTO_DATA_PTR OldPassword,
                                       const CSSM_CRYPTO_DATA_PTR NewPassword);


/* 
 * Cryptography Operations API 
 */

/* Returns a signature item */
CSSM_RETURN CSSMAPI CSSM_SignData     (CSSM_CC_HANDLE CCHandle,
                                       const CSSM_DATA_PTR DataBufs,
                                       uint32 DataBufCount,
                                       CSSM_DATA_PTR Signature);

CSSM_BOOL   CSSMAPI CSSM_VerifyData   (CSSM_CC_HANDLE CCHandle,
                                       const CSSM_DATA_PTR DataBufs,
                                       uint32 DataBufCount,
                                       const CSSM_DATA_PTR Signature);

/* Returns a digest item */
CSSM_RETURN CSSMAPI CSSM_DigestData   (CSSM_CC_HANDLE CCHandle,
                                       const CSSM_DATA_PTR DataBufs,
                                       uint32 DataBufCount,
                                       CSSM_DATA_PTR Digest);

CSSM_RETURN CSSMAPI CSSM_QuerySize    (CSSM_CC_HANDLE CCHandle,
                                       CSSM_BOOL Encrypt,
                                       uint32 QuerySizeCount,
                                       CSSM_QUERY_SIZE_DATA_PTR DataBlock);

/* Returns the encrypted data */
CSSM_RETURN CSSMAPI CSSM_EncryptData  (CSSM_CC_HANDLE CCHandle,
                                       const CSSM_DATA_PTR ClearBufs,
                                       uint32 ClearBufCount,
                                       CSSM_DATA_PTR CipherBufs,
                                       uint32 CipherBufCount,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?