michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [scriptable, uuid(51191434-1dd2-11b2-a17c-e49c4e99a4e3)] michael@0: interface nsIPK11Token : nsISupports michael@0: { michael@0: const long ASK_EVERY_TIME = -1; michael@0: const long ASK_FIRST_TIME = 0; michael@0: const long ASK_EXPIRE_TIME = 1; michael@0: michael@0: /* michael@0: * The name of the token michael@0: */ michael@0: readonly attribute wstring tokenName; michael@0: michael@0: readonly attribute wstring tokenLabel; michael@0: readonly attribute wstring tokenManID; michael@0: readonly attribute wstring tokenHWVersion; michael@0: readonly attribute wstring tokenFWVersion; michael@0: readonly attribute wstring tokenSerialNumber; michael@0: michael@0: /* michael@0: * Login information michael@0: */ michael@0: boolean isLoggedIn(); michael@0: void login(in boolean force); michael@0: void logoutSimple(); michael@0: void logoutAndDropAuthenticatedResources(); michael@0: michael@0: /* michael@0: * Reset password michael@0: */ michael@0: void reset(); michael@0: michael@0: /* michael@0: * Password information michael@0: */ michael@0: readonly attribute long minimumPasswordLength; michael@0: readonly attribute boolean needsUserInit; michael@0: boolean checkPassword(in wstring password); /* Logs out if check fails */ michael@0: void initPassword(in wstring initialPassword); michael@0: void changePassword(in wstring oldPassword, in wstring newPassword); michael@0: long getAskPasswordTimes(); michael@0: long getAskPasswordTimeout(); michael@0: void setAskPasswordDefaults([const] in long askTimes, [const] in long timeout); michael@0: michael@0: /* michael@0: * Other attributes michael@0: */ michael@0: boolean isHardwareToken(); michael@0: boolean needsLogin(); michael@0: boolean isFriendly(); michael@0: }; michael@0: