Description
Currently, the System.Security.Cryptography.HashAlgorithmName methods throw a PlatformNotSupportedException when executed in a C# program that got compiled against the wasi-wasm runtime. While the WASI Crypto API hasn't been finalized (AFAICT) and wasmtime doesn't provide any implementation, it would be really useful if at least the managed implementation of these crypto functions were available for programs running under wasi-wasm.
Reproduction Steps
Compile any program accessing any of the crypto functions (e.g. SHA1). When run an exception will be thrown:
System.PlatformNotSupportedException: SystemSecurityCryptography_PlatformNotSupported
at System.Security.Cryptography.SHA1.Create()
...
Expected behavior
While no WASI Crypto API has been finalized and made available via wasmtime, it would be really useful if the managed implementations could be used. I am trying to use Roslyn APIs, which internally use both SHA1 and SHA256 and thus cannot be executed under wasi-wasm.
Actual behavior
A PlatformNotSupportedException gets thrown.
Regression?
No response
Known Workarounds
No response
Configuration
- .NET 9 (preview 1)
- wasi-wasm runtime platform
Other information
No response
Description
Currently, the
System.Security.Cryptography.HashAlgorithmNamemethods throw aPlatformNotSupportedExceptionwhen executed in a C# program that got compiled against thewasi-wasmruntime. While the WASI Crypto API hasn't been finalized (AFAICT) andwasmtimedoesn't provide any implementation, it would be really useful if at least the managed implementation of these crypto functions were available for programs running under wasi-wasm.Reproduction Steps
Compile any program accessing any of the crypto functions (e.g. SHA1). When run an exception will be thrown:
Expected behavior
While no WASI Crypto API has been finalized and made available via
wasmtime, it would be really useful if the managed implementations could be used. I am trying to use Roslyn APIs, which internally use both SHA1 and SHA256 and thus cannot be executed under wasi-wasm.Actual behavior
A
PlatformNotSupportedExceptiongets thrown.Regression?
No response
Known Workarounds
No response
Configuration
Other information
No response