一个直截了当的问题。您是否知道是否有可能使用pkcs11 Interop更改令牌的SO-pin(在我的情况下为ePass2003)?提前谢谢了。
答案 0 :(得分:3)
目前我找不到我的ePass2003进行测试,但我会尝试使用此代码:
using Net.Pkcs11Interop.Common;
using Net.Pkcs11Interop.HighLevelAPI;
namespace ConsoleApp1
{
class Program
{
static string pkcs11Library = "opensc-pkcs11";
static string oldSoPin = "1111111111";
static string newSoPin = "2222222222";
static void Main(string[] args)
{
using (Pkcs11 pkcs11 = new Pkcs11(pkcs11Library, AppType.SingleThreaded))
{
Slot firstSlot = pkcs11.GetSlotList(SlotsType.WithTokenPresent)[0];
using (Session session = firstSlot.OpenSession(SessionType.ReadWrite))
{
session.Login(CKU.CKU_SO, oldSoPin);
session.SetPin(oldSoPin, newSoPin);
}
}
}
}
}