Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.PlatformNotSupportedException when trying to create an algorithm instance (Aes.Create) in Blazor #60897

Closed
ghost opened this issue Oct 26, 2021 · 4 comments
Labels
arch-wasm WebAssembly architecture area-System.Security untriaged New issue has not been triaged by the area owner

Comments

@ghost
Copy link

ghost commented Oct 26, 2021

Right now, the Aes.Create() is used to create a platform specific AES algorithm.
Doing so in the browser (using Blazor) is not support and throws the following exception: System.PlatformNotSupportedException: System.Security.Cryptography.Algorithms is not supported on this platform.

I just do not know what are my options here or how to get around this?

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Security untriaged New issue has not been triaged by the area owner labels Oct 26, 2021
@ghost
Copy link

ghost commented Oct 26, 2021

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks
See info in area-owners.md if you want to be subscribed.

Issue Details

Right now, the Aes.Create() is used to create a platform specific AES algorithm.
Doing so in the browser (using Blazor) is not support and throws the following exception: System.PlatformNotSupportedException: System.Security.Cryptography.Algorithms is not supported on this platform.

I just do not know what are my options here or how to get around this?

Author: SherifRefaat
Assignees: -
Labels:

area-System.Security, untriaged

Milestone: -

@vcsjones
Copy link
Member

vcsjones commented Oct 27, 2021

Currently for .NET 5 and 6, Aes is not supported in blazor. See the roadmap for additional information about which cryptography in .NET is supported in Blazor and planned support. The issue #42384 tracks adding Aes to blazor / WebAssembly.

I just do not know what are my options here or how to get around this?

The linked roadmap also includes an interop example to use the WebCrypto APIs provided by browsers. The linked example is for HMAC, but the principles should hold for AES as well.

@vcsjones vcsjones added the arch-wasm WebAssembly architecture label Oct 27, 2021
@ghost
Copy link

ghost commented Oct 27, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Right now, the Aes.Create() is used to create a platform specific AES algorithm.
Doing so in the browser (using Blazor) is not support and throws the following exception: System.PlatformNotSupportedException: System.Security.Cryptography.Algorithms is not supported on this platform.

I just do not know what are my options here or how to get around this?

Author: SherifRefaat
Assignees: -
Labels:

arch-wasm, area-System.Security, untriaged

Milestone: -

@ghost
Copy link
Author

ghost commented Oct 27, 2021

@vcsjones Thank you for your help. I am closing this issue.

@ghost ghost closed this as completed Oct 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Security untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant