Files

85 lines
2.0 KiB
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
using SECMODModuleID from "secmodt.h";
using CK_SLOT_ID from "pkcs11t.h";
namespace mozilla {
namespace psm {
struct TokenInfo {
SECMODModuleID moduleID;
CK_SLOT_ID slotID;
nsCString name;
nsCString manID;
nsCString hwVersion;
nsCString fwVersion;
nsCString serialNumber;
bool isLoggedIn;
bool canHavePassword;
bool hasPassword;
};
struct SlotInfo {
nsCString name;
nsCString desc;
nsCString manID;
nsCString hwVersion;
nsCString fwVersion;
uint32_t status;
nsCString tokenName;
TokenInfo? tokenInfo;
};
struct ModuleInfo {
nsCString name;
nsCString libName;
SlotInfo[] slots;
};
[ChildProc=Utility]
protocol PPKCS11Module
{
child:
async AddModule(
nsCString aModuleName,
nsCString aLibraryPath,
uint32_t aMechanismFlags,
uint32_t aCipherFlags
) returns (nsresult rv);
async DeleteModule(nsCString aModuleName) returns (nsresult rv);
async ListModules() returns (nsresult rv, ModuleInfo[] modules);
async ResetToken(SECMODModuleID moduleID, CK_SLOT_ID slotID)
returns (nsresult rv, TokenInfo tokenInfo);
async LoginToken(SECMODModuleID moduleID, CK_SLOT_ID slotID)
returns (nsresult rv, TokenInfo tokenInfo);
async LogoutToken(SECMODModuleID moduleID, CK_SLOT_ID slotID)
returns (nsresult rv, TokenInfo tokenInfo);
async ChangeTokenPassword(SECMODModuleID moduleID, CK_SLOT_ID slotID,
nsCString oldPassword, nsCString newPassword)
returns (nsresult rv, TokenInfo tokenInfo);
async CancelProtectedAuth(uint64_t id);
parent:
async PromptPassword(nsCString aTokenName)
returns (nsresult rv, nsCString password);
async ShowProtectedAuthPrompt(nsCString aTokenName, uint64_t id);
async DismissProtectedAuthPrompt(uint64_t id);
};
} // namespace psm
} // namespace mozilla