b4b1b2dadf77c4b847b342dc73c3073c2fe0378b
[platform/upstream/nss.git] / nss / lib / softoken / softoknt.h
1 /*
2  * softoknt.h - public data structures for the software token library
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8 #ifndef _SOFTOKNT_H_
9 #define _SOFTOKNT_H_
10
11 /*
12  * RSA block types
13  *
14  * The actual values are important -- they are fixed, *not* arbitrary.
15  * The explicit value assignments are not needed (because C would give
16  * us those same values anyway) but are included as a reminder...
17  */
18 typedef enum {
19     RSA_BlockPrivate0 = 0,      /* unused, really */
20     RSA_BlockPrivate = 1,       /* pad for a private-key operation */
21     RSA_BlockPublic = 2,        /* pad for a public-key operation */
22     RSA_BlockRaw = 4,           /* simply justify the block appropriately */
23     RSA_BlockTotal
24 } RSA_BlockType;
25
26 #define NSS_SOFTOKEN_DEFAULT_CHUNKSIZE   2048
27
28 /*
29  * FIPS 140-2 auditing
30  */
31 typedef enum {
32     NSS_AUDIT_ERROR = 3,    /* errors */
33     NSS_AUDIT_WARNING = 2,  /* warning messages */
34     NSS_AUDIT_INFO = 1      /* informational messages */
35 } NSSAuditSeverity;
36
37 typedef enum {
38     NSS_AUDIT_ACCESS_KEY = 0,
39     NSS_AUDIT_CHANGE_KEY,
40     NSS_AUDIT_COPY_KEY,
41     NSS_AUDIT_CRYPT,
42     NSS_AUDIT_DERIVE_KEY,
43     NSS_AUDIT_DESTROY_KEY,
44     NSS_AUDIT_DIGEST_KEY,
45     NSS_AUDIT_FIPS_STATE,
46     NSS_AUDIT_GENERATE_KEY,
47     NSS_AUDIT_INIT_PIN,
48     NSS_AUDIT_INIT_TOKEN,
49     NSS_AUDIT_LOAD_KEY,
50     NSS_AUDIT_LOGIN,
51     NSS_AUDIT_LOGOUT,
52     NSS_AUDIT_SELF_TEST,
53     NSS_AUDIT_SET_PIN,
54     NSS_AUDIT_UNWRAP_KEY,
55     NSS_AUDIT_WRAP_KEY
56 } NSSAuditType;
57
58 #endif /* _SOFTOKNT_H_ */