Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef NSSCKFWT_H |
michael@0 | 6 | #define NSSCKFWT_H |
michael@0 | 7 | |
michael@0 | 8 | /* |
michael@0 | 9 | * nssckfwt.h |
michael@0 | 10 | * |
michael@0 | 11 | * This file declares the public types used by the NSS Cryptoki Framework. |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | /* |
michael@0 | 15 | * NSSCKFWInstance |
michael@0 | 16 | * |
michael@0 | 17 | */ |
michael@0 | 18 | |
michael@0 | 19 | struct NSSCKFWInstanceStr; |
michael@0 | 20 | typedef struct NSSCKFWInstanceStr NSSCKFWInstance; |
michael@0 | 21 | |
michael@0 | 22 | /* |
michael@0 | 23 | * NSSCKFWSlot |
michael@0 | 24 | * |
michael@0 | 25 | */ |
michael@0 | 26 | |
michael@0 | 27 | struct NSSCKFWSlotStr; |
michael@0 | 28 | typedef struct NSSCKFWSlotStr NSSCKFWSlot; |
michael@0 | 29 | |
michael@0 | 30 | /* |
michael@0 | 31 | * NSSCKFWToken |
michael@0 | 32 | * |
michael@0 | 33 | */ |
michael@0 | 34 | |
michael@0 | 35 | struct NSSCKFWTokenStr; |
michael@0 | 36 | typedef struct NSSCKFWTokenStr NSSCKFWToken; |
michael@0 | 37 | |
michael@0 | 38 | /* |
michael@0 | 39 | * NSSCKFWMechanism |
michael@0 | 40 | * |
michael@0 | 41 | */ |
michael@0 | 42 | |
michael@0 | 43 | struct NSSCKFWMechanismStr; |
michael@0 | 44 | typedef struct NSSCKFWMechanismStr NSSCKFWMechanism; |
michael@0 | 45 | |
michael@0 | 46 | /* |
michael@0 | 47 | * NSSCKFWCryptoOperation |
michael@0 | 48 | * |
michael@0 | 49 | */ |
michael@0 | 50 | |
michael@0 | 51 | struct NSSCKFWCryptoOperationStr; |
michael@0 | 52 | typedef struct NSSCKFWCryptoOperationStr NSSCKFWCryptoOperation; |
michael@0 | 53 | |
michael@0 | 54 | |
michael@0 | 55 | /* |
michael@0 | 56 | * NSSCKFWSession |
michael@0 | 57 | * |
michael@0 | 58 | */ |
michael@0 | 59 | |
michael@0 | 60 | struct NSSCKFWSessionStr; |
michael@0 | 61 | typedef struct NSSCKFWSessionStr NSSCKFWSession; |
michael@0 | 62 | |
michael@0 | 63 | /* |
michael@0 | 64 | * NSSCKFWObject |
michael@0 | 65 | * |
michael@0 | 66 | */ |
michael@0 | 67 | |
michael@0 | 68 | struct NSSCKFWObjectStr; |
michael@0 | 69 | typedef struct NSSCKFWObjectStr NSSCKFWObject; |
michael@0 | 70 | |
michael@0 | 71 | /* |
michael@0 | 72 | * NSSCKFWFindObjects |
michael@0 | 73 | * |
michael@0 | 74 | */ |
michael@0 | 75 | |
michael@0 | 76 | struct NSSCKFWFindObjectsStr; |
michael@0 | 77 | typedef struct NSSCKFWFindObjectsStr NSSCKFWFindObjects; |
michael@0 | 78 | |
michael@0 | 79 | /* |
michael@0 | 80 | * NSSCKFWMutex |
michael@0 | 81 | * |
michael@0 | 82 | */ |
michael@0 | 83 | |
michael@0 | 84 | struct NSSCKFWMutexStr; |
michael@0 | 85 | typedef struct NSSCKFWMutexStr NSSCKFWMutex; |
michael@0 | 86 | |
michael@0 | 87 | typedef enum { |
michael@0 | 88 | SingleThreaded, |
michael@0 | 89 | MultiThreaded |
michael@0 | 90 | } CryptokiLockingState ; |
michael@0 | 91 | |
michael@0 | 92 | /* used as an index into an array, make sure it starts at '0' */ |
michael@0 | 93 | typedef enum { |
michael@0 | 94 | NSSCKFWCryptoOperationState_EncryptDecrypt = 0, |
michael@0 | 95 | NSSCKFWCryptoOperationState_SignVerify, |
michael@0 | 96 | NSSCKFWCryptoOperationState_Digest, |
michael@0 | 97 | NSSCKFWCryptoOperationState_Max |
michael@0 | 98 | } NSSCKFWCryptoOperationState; |
michael@0 | 99 | |
michael@0 | 100 | typedef enum { |
michael@0 | 101 | NSSCKFWCryptoOperationType_Encrypt, |
michael@0 | 102 | NSSCKFWCryptoOperationType_Decrypt, |
michael@0 | 103 | NSSCKFWCryptoOperationType_Digest, |
michael@0 | 104 | NSSCKFWCryptoOperationType_Sign, |
michael@0 | 105 | NSSCKFWCryptoOperationType_Verify, |
michael@0 | 106 | NSSCKFWCryptoOperationType_SignRecover, |
michael@0 | 107 | NSSCKFWCryptoOperationType_VerifyRecover |
michael@0 | 108 | } NSSCKFWCryptoOperationType; |
michael@0 | 109 | |
michael@0 | 110 | #endif /* NSSCKFWT_H */ |