1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/. */
7 #include
"nsISupports.idl"
9 [scriptable
, uuid(51191434-1dd2
-11b2
-a17c
-e49c4e99a4e3
)]
10 interface nsIPK11Token
: nsISupports
13 * The name of the token
16 readonly attribute AUTF8String tokenName
;
18 readonly attribute
boolean isInternalKeyToken
;
20 * Manufacturer ID of the token.
23 readonly attribute AUTF8String tokenManID
;
25 * Hardware version of the token.
28 readonly attribute AUTF8String tokenHWVersion
;
30 * Firmware version of the token.
33 readonly attribute AUTF8String tokenFWVersion
;
35 readonly attribute AUTF8String tokenSerialNumber
;
43 void login
(in boolean force
);
47 void logoutAndDropAuthenticatedResources
();
51 readonly attribute
boolean needsUserInit
;
60 * Checks whether the given password is correct. Logs the token out if an
61 * incorrect password is given.
63 * @param password The password to check.
64 * @return true if the password was correct, false otherwise.
67 boolean checkPassword
(in AUTF8String password
);
69 void initPassword
(in AUTF8String initialPassword
);
71 void changePassword
(in AUTF8String oldPassword
, in AUTF8String newPassword
);
74 * True if a password has been configured for this token, and false otherwise.
75 * (Whether or not the user is currently logged in makes no difference.)
76 * In particular, this can be used to determine if a user has set a master
77 * password (if this is the internal key token).
80 readonly attribute
boolean hasPassword
;