|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 [scriptable, uuid(51191434-1dd2-11b2-a17c-e49c4e99a4e3)] |
|
10 interface nsIPK11Token : nsISupports |
|
11 { |
|
12 const long ASK_EVERY_TIME = -1; |
|
13 const long ASK_FIRST_TIME = 0; |
|
14 const long ASK_EXPIRE_TIME = 1; |
|
15 |
|
16 /* |
|
17 * The name of the token |
|
18 */ |
|
19 readonly attribute wstring tokenName; |
|
20 |
|
21 readonly attribute wstring tokenLabel; |
|
22 readonly attribute wstring tokenManID; |
|
23 readonly attribute wstring tokenHWVersion; |
|
24 readonly attribute wstring tokenFWVersion; |
|
25 readonly attribute wstring tokenSerialNumber; |
|
26 |
|
27 /* |
|
28 * Login information |
|
29 */ |
|
30 boolean isLoggedIn(); |
|
31 void login(in boolean force); |
|
32 void logoutSimple(); |
|
33 void logoutAndDropAuthenticatedResources(); |
|
34 |
|
35 /* |
|
36 * Reset password |
|
37 */ |
|
38 void reset(); |
|
39 |
|
40 /* |
|
41 * Password information |
|
42 */ |
|
43 readonly attribute long minimumPasswordLength; |
|
44 readonly attribute boolean needsUserInit; |
|
45 boolean checkPassword(in wstring password); /* Logs out if check fails */ |
|
46 void initPassword(in wstring initialPassword); |
|
47 void changePassword(in wstring oldPassword, in wstring newPassword); |
|
48 long getAskPasswordTimes(); |
|
49 long getAskPasswordTimeout(); |
|
50 void setAskPasswordDefaults([const] in long askTimes, [const] in long timeout); |
|
51 |
|
52 /* |
|
53 * Other attributes |
|
54 */ |
|
55 boolean isHardwareToken(); |
|
56 boolean needsLogin(); |
|
57 boolean isFriendly(); |
|
58 }; |
|
59 |