【发布时间】:2019-06-28 05:51:12
【问题描述】:
我遇到了有关创建虚拟智能卡的问题。 RequestVirtualSmartCardCreationAsync() 抛出一个奇怪的异常。我附上了sn-p的代码。
public async void ScenarioCreateTpmVirtualSmartCard()
{
IBuffer adminKey = CryptographicBuffer.CreateFromByteArray(
new byte[] {
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
});
SmartCardPinPolicy pinPolicy = new SmartCardPinPolicy()
{
MinLength = 8,
MaxLength = 127,
LowercaseLetters = SmartCardPinCharacterPolicyOption.Allow,
UppercaseLetters = SmartCardPinCharacterPolicyOption.Allow,
Digits = SmartCardPinCharacterPolicyOption.Allow,
SpecialCharacters = SmartCardPinCharacterPolicyOption.Allow
};
SmartCardProvisioning cardProvisioning = await SmartCardProvisioning.RequestVirtualSmartCardCreationAsync(
"Contoso Virtual Smart Card", adminKey, pinPolicy, Guid.NewGuid());
if (cardProvisioning == null)
return;
}
问题是当我运行这个方法时,我得到 System.Exception 说
未找到元素。 (HResult 异常:0x80070490)
我正在使用 VS 2017,并在 Windows 10 上运行此示例。任何帮助将不胜感激...
【问题讨论】: