microsoft / microsoft/WindowsAppSDK
Unable to create Virtual smartcard
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 471
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 28
Description
### Describe the bug
I have a basic test app using VS Studio Blank app for winUi 3 where I try to call the following code
When I try to run the following code which works in UWP
SmartCardPinPolicy pinPolicy = new SmartCardPinPolicy();
pinPolicy.MinLength = 6;
IBuffer adminkey = CryptographicBuffer.GenerateRandom(24);
SmartCardProvisioning provisioning = await
SmartCardProvisioning.RequestVirtualSmartCardCreationAsync(
"Card friendly name",
adminkey,
pinPolicy);
I get the runtime error
Exception thrown: 'System.Runtime.InteropServices.COMException' in WinRT.Runtime.dll
Are some components of Windows.Devices.SmartCards; not supported. ? Will they ever be supported or should we move to PInvokes
Trying to migrate a UWP app
### Steps to reproduce the bug
create a blank project
Open Visual Studio, and on the start window, choose Create a new project.
On the Create a new project screen, enter WinUI in the search box, choose the C# template for Blank App, Packaged (WinUI 3 in Desktop), and then choose Next.
add the following code to some button click
SmartCardPinPolicy pinPolicy = new SmartCardPinPolicy();
pinPolicy.MinLength = 6;
IBuffer adminkey = CryptographicBuffer.GenerateRandom(24);
SmartCardProvisioning provisioning = await
SmartCardProvisioning.RequestVirtualSmartCardCreationAsync(
"Card friendly name",
adminkey,
pinPolicy);
### Expected behavior
A set PIN Prompt dialog should be presented and virtual smartcard instance should be created
### Screenshots
_No response_
### NuGet package version
None
### Packaging type
Unpackaged
### Windows version
_No response_
### IDE
Visual Studio 2022
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal WinUI 3 Blank App reproduction and the SmartCardProvisioning.RequestVirtualSmartCardCreationAsync call described in the issue. Compare its behavior with the working UWP scenario and determine whether virtual smartcard creation is supported for this packaging configuration. Done means documenting the support status and an appropriate migration path, including whether a workaround is required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100