/gecko_api/include/nssckfw.h
C++ Header | 526 lines | 203 code | 76 blank | 247 comment | 0 complexity | 2819a53de4dc9cfd5ba851e7a2edc1f2 MD5 | raw file
1/* ***** BEGIN LICENSE BLOCK ***** 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 * 4 * The contents of this file are subject to the Mozilla Public License Version 5 * 1.1 (the "License"); you may not use this file except in compliance with 6 * the License. You may obtain a copy of the License at 7 * http://www.mozilla.org/MPL/ 8 * 9 * Software distributed under the License is distributed on an "AS IS" basis, 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 * for the specific language governing rights and limitations under the 12 * License. 13 * 14 * The Original Code is the Netscape security libraries. 15 * 16 * The Initial Developer of the Original Code is 17 * Netscape Communications Corporation. 18 * Portions created by the Initial Developer are Copyright (C) 1994-2000 19 * the Initial Developer. All Rights Reserved. 20 * 21 * Contributor(s): 22 * 23 * Alternatively, the contents of this file may be used under the terms of 24 * either the GNU General Public License Version 2 or later (the "GPL"), or 25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 26 * in which case the provisions of the GPL or the LGPL are applicable instead 27 * of those above. If you wish to allow use of your version of this file only 28 * under the terms of either the GPL or the LGPL, and not to allow others to 29 * use your version of this file under the terms of the MPL, indicate your 30 * decision by deleting the provisions above and replace them with the notice 31 * and other provisions required by the GPL or the LGPL. If you do not delete 32 * the provisions above, a recipient may use your version of this file under 33 * the terms of any one of the MPL, the GPL or the LGPL. 34 * 35 * ***** END LICENSE BLOCK ***** */ 36 37#ifndef NSSCKFW_H 38#define NSSCKFW_H 39 40#ifdef DEBUG 41static const char NSSCKFW_CVS_ID[] = "@(#) $RCSfile: nssckfw.h,v $ $Revision: 1.5 $ $Date: 2005/12/16 00:48:01 $"; 42#endif /* DEBUG */ 43 44/* 45 * nssckfw.h 46 * 47 * This file prototypes the publicly available calls of the 48 * NSS Cryptoki Framework. 49 */ 50 51#ifndef NSSBASET_H 52#include "nssbaset.h" 53#endif /* NSSBASET_H */ 54 55#ifndef NSSCKT_H 56#include "nssckt.h" 57#endif /* NSSCKT_H */ 58 59#ifndef NSSCKFWT_H 60#include "nssckfwt.h" 61#endif /* NSSCKFWT_H */ 62 63/* 64 * NSSCKFWInstance 65 * 66 * NSSCKFWInstance_GetMDInstance 67 * NSSCKFWInstance_GetArena 68 * NSSCKFWInstance_MayCreatePthreads 69 * NSSCKFWInstance_CreateMutex 70 * NSSCKFWInstance_GetConfigurationData 71 */ 72 73/* 74 * NSSCKFWInstance_GetMDInstance 75 * 76 */ 77 78NSS_EXTERN NSSCKMDInstance * 79NSSCKFWInstance_GetMDInstance 80( 81 NSSCKFWInstance *fwInstance 82); 83 84/* 85 * NSSCKFWInstance_GetArena 86 * 87 */ 88 89NSS_EXTERN NSSArena * 90NSSCKFWInstance_GetArena 91( 92 NSSCKFWInstance *fwInstance, 93 CK_RV *pError 94); 95 96/* 97 * NSSCKFWInstance_MayCreatePthreads 98 * 99 */ 100 101NSS_EXTERN CK_BBOOL 102NSSCKFWInstance_MayCreatePthreads 103( 104 NSSCKFWInstance *fwInstance 105); 106 107/* 108 * NSSCKFWInstance_CreateMutex 109 * 110 */ 111 112NSS_EXTERN NSSCKFWMutex * 113NSSCKFWInstance_CreateMutex 114( 115 NSSCKFWInstance *fwInstance, 116 NSSArena *arena, 117 CK_RV *pError 118); 119 120/* 121 * NSSCKFWInstance_GetConfigurationData 122 * 123 */ 124 125NSS_EXTERN NSSUTF8 * 126NSSCKFWInstance_GetConfigurationData 127( 128 NSSCKFWInstance *fwInstance 129); 130 131/* 132 * NSSCKFWInstance_GetInitArgs 133 * 134 */ 135 136NSS_EXTERN CK_C_INITIALIZE_ARGS_PTR 137NSSCKFWInstance_GetInitArgs 138( 139 NSSCKFWInstance *fwInstance 140); 141 142/* 143 * NSSCKFWSlot 144 * 145 * NSSCKFWSlot_GetMDSlot 146 * NSSCKFWSlot_GetFWInstance 147 * NSSCKFWSlot_GetMDInstance 148 * 149 */ 150 151/* 152 * NSSCKFWSlot_GetMDSlot 153 * 154 */ 155 156NSS_EXTERN NSSCKMDSlot * 157NSSCKFWSlot_GetMDSlot 158( 159 NSSCKFWSlot *fwSlot 160); 161 162/* 163 * NSSCKFWSlot_GetFWInstance 164 * 165 */ 166 167NSS_EXTERN NSSCKFWInstance * 168NSSCKFWSlot_GetFWInstance 169( 170 NSSCKFWSlot *fwSlot 171); 172 173/* 174 * NSSCKFWSlot_GetMDInstance 175 * 176 */ 177 178NSS_EXTERN NSSCKMDInstance * 179NSSCKFWSlot_GetMDInstance 180( 181 NSSCKFWSlot *fwSlot 182); 183 184/* 185 * NSSCKFWToken 186 * 187 * NSSCKFWToken_GetMDToken 188 * NSSCKFWToken_GetFWSlot 189 * NSSCKFWToken_GetMDSlot 190 * NSSCKFWToken_GetSessionState 191 * 192 */ 193 194/* 195 * NSSCKFWToken_GetMDToken 196 * 197 */ 198 199NSS_EXTERN NSSCKMDToken * 200NSSCKFWToken_GetMDToken 201( 202 NSSCKFWToken *fwToken 203); 204 205/* 206 * NSSCKFWToken_GetArena 207 * 208 */ 209 210NSS_EXTERN NSSArena * 211NSSCKFWToken_GetArena 212( 213 NSSCKFWToken *fwToken, 214 CK_RV *pError 215); 216 217/* 218 * NSSCKFWToken_GetFWSlot 219 * 220 */ 221 222NSS_EXTERN NSSCKFWSlot * 223NSSCKFWToken_GetFWSlot 224( 225 NSSCKFWToken *fwToken 226); 227 228/* 229 * NSSCKFWToken_GetMDSlot 230 * 231 */ 232 233NSS_EXTERN NSSCKMDSlot * 234NSSCKFWToken_GetMDSlot 235( 236 NSSCKFWToken *fwToken 237); 238 239/* 240 * NSSCKFWToken_GetSessionState 241 * 242 */ 243 244NSS_EXTERN CK_STATE 245NSSCKFWToken_GetSessionState 246( 247 NSSCKFWToken *fwToken 248); 249 250/* 251 * NSSCKFWMechanism 252 * 253 * NSSKCFWMechanism_GetMDMechanism 254 * NSSCKFWMechanism_GetParameter 255 * 256 */ 257 258/* 259 * NSSKCFWMechanism_GetMDMechanism 260 * 261 */ 262 263NSS_EXTERN NSSCKMDMechanism * 264NSSCKFWMechanism_GetMDMechanism 265( 266 NSSCKFWMechanism *fwMechanism 267); 268 269/* 270 * NSSCKFWMechanism_GetParameter 271 * 272 */ 273 274NSS_EXTERN NSSItem * 275NSSCKFWMechanism_GetParameter 276( 277 NSSCKFWMechanism *fwMechanism 278); 279 280/* 281 * NSSCKFWSession 282 * 283 * NSSCKFWSession_GetMDSession 284 * NSSCKFWSession_GetArena 285 * NSSCKFWSession_CallNotification 286 * NSSCKFWSession_IsRWSession 287 * NSSCKFWSession_IsSO 288 * NSSCKFWSession_GetCurrentCryptoOperation 289 * 290 */ 291 292/* 293 * NSSCKFWSession_GetMDSession 294 * 295 */ 296 297NSS_EXTERN NSSCKMDSession * 298NSSCKFWSession_GetMDSession 299( 300 NSSCKFWSession *fwSession 301); 302 303/* 304 * NSSCKFWSession_GetArena 305 * 306 */ 307 308NSS_EXTERN NSSArena * 309NSSCKFWSession_GetArena 310( 311 NSSCKFWSession *fwSession, 312 CK_RV *pError 313); 314 315/* 316 * NSSCKFWSession_CallNotification 317 * 318 */ 319 320NSS_EXTERN CK_RV 321NSSCKFWSession_CallNotification 322( 323 NSSCKFWSession *fwSession, 324 CK_NOTIFICATION event 325); 326 327/* 328 * NSSCKFWSession_IsRWSession 329 * 330 */ 331 332NSS_EXTERN CK_BBOOL 333NSSCKFWSession_IsRWSession 334( 335 NSSCKFWSession *fwSession 336); 337 338/* 339 * NSSCKFWSession_IsSO 340 * 341 */ 342 343NSS_EXTERN CK_BBOOL 344NSSCKFWSession_IsSO 345( 346 NSSCKFWSession *fwSession 347); 348 349/* 350 * NSSCKFWSession_GetCurrentCryptoOperation 351 * 352 */ 353 354NSS_EXTERN NSSCKFWCryptoOperation * 355NSSCKFWSession_GetCurrentCryptoOperation 356( 357 NSSCKFWSession *fwSession, 358 NSSCKFWCryptoOperationState state 359); 360 361/* 362 * NSSCKFWObject 363 * 364 * NSSCKFWObject_GetMDObject 365 * NSSCKFWObject_GetArena 366 * NSSCKFWObject_IsTokenObject 367 * NSSCKFWObject_GetAttributeCount 368 * NSSCKFWObject_GetAttributeTypes 369 * NSSCKFWObject_GetAttributeSize 370 * NSSCKFWObject_GetAttribute 371 * NSSCKFWObject_GetObjectSize 372 */ 373 374/* 375 * NSSCKFWObject_GetMDObject 376 * 377 */ 378NSS_EXTERN NSSCKMDObject * 379NSSCKFWObject_GetMDObject 380( 381 NSSCKFWObject *fwObject 382); 383 384/* 385 * NSSCKFWObject_GetArena 386 * 387 */ 388NSS_EXTERN NSSArena * 389NSSCKFWObject_GetArena 390( 391 NSSCKFWObject *fwObject, 392 CK_RV *pError 393); 394 395/* 396 * NSSCKFWObject_IsTokenObject 397 * 398 */ 399NSS_EXTERN CK_BBOOL 400NSSCKFWObject_IsTokenObject 401( 402 NSSCKFWObject *fwObject 403); 404 405/* 406 * NSSCKFWObject_GetAttributeCount 407 * 408 */ 409NSS_EXTERN CK_ULONG 410NSSCKFWObject_GetAttributeCount 411( 412 NSSCKFWObject *fwObject, 413 CK_RV *pError 414); 415 416/* 417 * NSSCKFWObject_GetAttributeTypes 418 * 419 */ 420NSS_EXTERN CK_RV 421NSSCKFWObject_GetAttributeTypes 422( 423 NSSCKFWObject *fwObject, 424 CK_ATTRIBUTE_TYPE_PTR typeArray, 425 CK_ULONG ulCount 426); 427 428/* 429 * NSSCKFWObject_GetAttributeSize 430 * 431 */ 432NSS_EXTERN CK_ULONG 433NSSCKFWObject_GetAttributeSize 434( 435 NSSCKFWObject *fwObject, 436 CK_ATTRIBUTE_TYPE attribute, 437 CK_RV *pError 438); 439 440/* 441 * NSSCKFWObject_GetAttribute 442 * 443 */ 444NSS_EXTERN NSSItem * 445NSSCKFWObject_GetAttribute 446( 447 NSSCKFWObject *fwObject, 448 CK_ATTRIBUTE_TYPE attribute, 449 NSSItem *itemOpt, 450 NSSArena *arenaOpt, 451 CK_RV *pError 452); 453 454/* 455 * NSSCKFWObject_GetObjectSize 456 * 457 */ 458NSS_EXTERN CK_ULONG 459NSSCKFWObject_GetObjectSize 460( 461 NSSCKFWObject *fwObject, 462 CK_RV *pError 463); 464 465/* 466 * NSSCKFWFindObjects 467 * 468 * NSSCKFWFindObjects_GetMDFindObjects 469 * 470 */ 471 472/* 473 * NSSCKFWFindObjects_GetMDFindObjects 474 * 475 */ 476 477NSS_EXTERN NSSCKMDFindObjects * 478NSSCKFWFindObjects_GetMDFindObjects 479( 480 NSSCKFWFindObjects * 481); 482 483/* 484 * NSSCKFWMutex 485 * 486 * NSSCKFWMutex_Destroy 487 * NSSCKFWMutex_Lock 488 * NSSCKFWMutex_Unlock 489 * 490 */ 491 492/* 493 * NSSCKFWMutex_Destroy 494 * 495 */ 496 497NSS_EXTERN CK_RV 498NSSCKFWMutex_Destroy 499( 500 NSSCKFWMutex *mutex 501); 502 503/* 504 * NSSCKFWMutex_Lock 505 * 506 */ 507 508NSS_EXTERN CK_RV 509NSSCKFWMutex_Lock 510( 511 NSSCKFWMutex *mutex 512); 513 514/* 515 * NSSCKFWMutex_Unlock 516 * 517 */ 518 519NSS_EXTERN CK_RV 520NSSCKFWMutex_Unlock 521( 522 NSSCKFWMutex *mutex 523); 524 525#endif /* NSSCKFW_H */ 526