1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/dev/devm.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,205 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef DEVM_H 1.9 +#define DEVM_H 1.10 + 1.11 +#ifndef BASE_H 1.12 +#include "base.h" 1.13 +#endif /* BASE_H */ 1.14 + 1.15 +#ifndef DEV_H 1.16 +#include "dev.h" 1.17 +#endif /* DEV_H */ 1.18 + 1.19 +#ifndef DEVTM_H 1.20 +#include "devtm.h" 1.21 +#endif /* DEVTM_H */ 1.22 + 1.23 +PR_BEGIN_EXTERN_C 1.24 + 1.25 +/* Shortcut to cryptoki API functions. */ 1.26 +#define CKAPI(epv) \ 1.27 + ((CK_FUNCTION_LIST_PTR)(epv)) 1.28 + 1.29 +NSS_EXTERN void 1.30 +nssDevice_AddRef 1.31 +( 1.32 + struct nssDeviceBaseStr *device 1.33 +); 1.34 + 1.35 +NSS_EXTERN PRBool 1.36 +nssDevice_Destroy 1.37 +( 1.38 + struct nssDeviceBaseStr *device 1.39 +); 1.40 + 1.41 +NSS_EXTERN PRBool 1.42 +nssModule_IsThreadSafe 1.43 +( 1.44 + NSSModule *module 1.45 +); 1.46 + 1.47 +NSS_EXTERN PRBool 1.48 +nssModule_IsInternal 1.49 +( 1.50 + NSSModule *mod 1.51 +); 1.52 + 1.53 +NSS_EXTERN PRBool 1.54 +nssModule_IsModuleDBOnly 1.55 +( 1.56 + NSSModule *mod 1.57 +); 1.58 + 1.59 +NSS_EXTERN void * 1.60 +nssModule_GetCryptokiEPV 1.61 +( 1.62 + NSSModule *mod 1.63 +); 1.64 + 1.65 +NSS_EXTERN NSSSlot * 1.66 +nssSlot_Create 1.67 +( 1.68 + CK_SLOT_ID slotId, 1.69 + NSSModule *parent 1.70 +); 1.71 + 1.72 +NSS_EXTERN void * 1.73 +nssSlot_GetCryptokiEPV 1.74 +( 1.75 + NSSSlot *slot 1.76 +); 1.77 + 1.78 +NSS_EXTERN NSSToken * 1.79 +nssToken_Create 1.80 +( 1.81 + CK_SLOT_ID slotID, 1.82 + NSSSlot *peer 1.83 +); 1.84 + 1.85 +NSS_EXTERN void * 1.86 +nssToken_GetCryptokiEPV 1.87 +( 1.88 + NSSToken *token 1.89 +); 1.90 + 1.91 +NSS_EXTERN nssSession * 1.92 +nssToken_GetDefaultSession 1.93 +( 1.94 + NSSToken *token 1.95 +); 1.96 + 1.97 +NSS_EXTERN PRBool 1.98 +nssToken_IsLoginRequired 1.99 +( 1.100 + NSSToken *token 1.101 +); 1.102 + 1.103 +NSS_EXTERN void 1.104 +nssToken_Remove 1.105 +( 1.106 + NSSToken *token 1.107 +); 1.108 + 1.109 +NSS_EXTERN nssCryptokiObject * 1.110 +nssCryptokiObject_Create 1.111 +( 1.112 + NSSToken *t, 1.113 + nssSession *session, 1.114 + CK_OBJECT_HANDLE h 1.115 +); 1.116 + 1.117 +NSS_EXTERN nssTokenObjectCache * 1.118 +nssTokenObjectCache_Create 1.119 +( 1.120 + NSSToken *token, 1.121 + PRBool cacheCerts, 1.122 + PRBool cacheTrust, 1.123 + PRBool cacheCRLs 1.124 +); 1.125 + 1.126 +NSS_EXTERN void 1.127 +nssTokenObjectCache_Destroy 1.128 +( 1.129 + nssTokenObjectCache *cache 1.130 +); 1.131 + 1.132 +NSS_EXTERN void 1.133 +nssTokenObjectCache_Clear 1.134 +( 1.135 + nssTokenObjectCache *cache 1.136 +); 1.137 + 1.138 +NSS_EXTERN PRBool 1.139 +nssTokenObjectCache_HaveObjectClass 1.140 +( 1.141 + nssTokenObjectCache *cache, 1.142 + CK_OBJECT_CLASS objclass 1.143 +); 1.144 + 1.145 +NSS_EXTERN nssCryptokiObject ** 1.146 +nssTokenObjectCache_FindObjectsByTemplate 1.147 +( 1.148 + nssTokenObjectCache *cache, 1.149 + CK_OBJECT_CLASS objclass, 1.150 + CK_ATTRIBUTE_PTR otemplate, 1.151 + CK_ULONG otlen, 1.152 + PRUint32 maximumOpt, 1.153 + PRStatus *statusOpt 1.154 +); 1.155 + 1.156 +NSS_EXTERN PRStatus 1.157 +nssTokenObjectCache_GetObjectAttributes 1.158 +( 1.159 + nssTokenObjectCache *cache, 1.160 + NSSArena *arenaOpt, 1.161 + nssCryptokiObject *object, 1.162 + CK_OBJECT_CLASS objclass, 1.163 + CK_ATTRIBUTE_PTR atemplate, 1.164 + CK_ULONG atlen 1.165 +); 1.166 + 1.167 +NSS_EXTERN PRStatus 1.168 +nssTokenObjectCache_ImportObject 1.169 +( 1.170 + nssTokenObjectCache *cache, 1.171 + nssCryptokiObject *object, 1.172 + CK_OBJECT_CLASS objclass, 1.173 + CK_ATTRIBUTE_PTR ot, 1.174 + CK_ULONG otlen 1.175 +); 1.176 + 1.177 +NSS_EXTERN void 1.178 +nssTokenObjectCache_RemoveObject 1.179 +( 1.180 + nssTokenObjectCache *cache, 1.181 + nssCryptokiObject *object 1.182 +); 1.183 + 1.184 +/* XXX allows peek back into token */ 1.185 +NSS_EXTERN PRStatus 1.186 +nssToken_GetCachedObjectAttributes 1.187 +( 1.188 + NSSToken *token, 1.189 + NSSArena *arenaOpt, 1.190 + nssCryptokiObject *object, 1.191 + CK_OBJECT_CLASS objclass, 1.192 + CK_ATTRIBUTE_PTR atemplate, 1.193 + CK_ULONG atlen 1.194 +); 1.195 + 1.196 +/* PKCS#11 stores strings in a fixed-length buffer padded with spaces. This 1.197 + * function gets the length of the actual string. 1.198 + */ 1.199 +NSS_EXTERN PRUint32 1.200 +nssPKCS11String_Length 1.201 +( 1.202 + CK_CHAR *pkcs11str, 1.203 + PRUint32 bufLen 1.204 +); 1.205 + 1.206 +PR_END_EXTERN_C 1.207 + 1.208 +#endif /* DEV_H */