我在创建虚拟智能卡时遇到问题。 RequestVirtualSmartCardCreationAsync()
抛出一个奇怪的异常。我正在附加代码段。
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上运行此示例。非常感谢您的帮助...