nsIPK11Token.idl (2135B)
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 /* 13 * The name of the token 14 */ 15 [must_use] 16 readonly attribute AUTF8String tokenName; 17 [must_use] 18 readonly attribute boolean isInternalKeyToken; 19 /** 20 * Manufacturer ID of the token. 21 */ 22 [must_use] 23 readonly attribute AUTF8String tokenManID; 24 /** 25 * Hardware version of the token. 26 */ 27 [must_use] 28 readonly attribute AUTF8String tokenHWVersion; 29 /** 30 * Firmware version of the token. 31 */ 32 [must_use] 33 readonly attribute AUTF8String tokenFWVersion; 34 [must_use] 35 readonly attribute AUTF8String tokenSerialNumber; 36 37 /* 38 * Login information 39 */ 40 [must_use] 41 boolean isLoggedIn(); 42 [must_use] 43 void login(in boolean force); 44 [must_use] 45 void logoutSimple(); 46 [must_use] 47 void logoutAndDropAuthenticatedResources(); 48 [must_use] 49 boolean needsLogin(); 50 [must_use] 51 readonly attribute boolean needsUserInit; 52 53 /* 54 * Reset password 55 */ 56 [must_use] 57 void reset(); 58 59 /** 60 * Checks whether the given password is correct. Logs the token out if an 61 * incorrect password is given. 62 * 63 * @param password The password to check. 64 * @return true if the password was correct, false otherwise. 65 */ 66 [must_use] 67 boolean checkPassword(in AUTF8String password); 68 [must_use] 69 void initPassword(in AUTF8String initialPassword); 70 [must_use] 71 void changePassword(in AUTF8String oldPassword, in AUTF8String newPassword); 72 73 /* 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). 78 */ 79 [must_use] 80 readonly attribute boolean hasPassword; 81 };