Questions tagged [system.security]
59 questions
2
votes
1 answer
different between RSACryptoServiceProvider and RSAPKCS1Signatureformatter
i am trying to get the difference between class RSAPKCS1Signatureformatter and RSACryptoServiceProvider
as when i sign data using RSAPKCS1Signatureformatter it returns different signature value than signing using RSACryptoServiceProvider .

Mohamed Elbadrawy
- 75
- 1
- 11
2
votes
2 answers
Visual Studio Code: Missing X509Certificate2UI
I get the following error when trying to use an X509Certificate2UI in VS Code:
The type or namespace name 'X509Certificate2UI' does not exist in the namespace 'System.Security.Cryptography.X509Certificates' (are you missing an assembly reference?)…

NattyP
- 163
- 1
- 7
2
votes
1 answer
Error When Accessing Certificate: Keyset Does Not Exist
I recently updated the certificate for two windows console application. In the past we have just renewed the certificate but this was not possible this time as our 3rd party provider no longer allows this. This time a new certificate was created…

Peter Duggan
- 21
- 1
- 2
2
votes
1 answer
Is there a limit for RSA key exponents in .NET?
Using C# I cannot import a public RSA key with an exponent of {1, 0, 0, 0, 15}: There is an exception:
System.Security.Cryptography.CryptographicException was caught
HResult=-2146893819
Message=Bad Data.
Source=mscorlib
StackTrace:
…

Thomas
- 33
- 3
2
votes
2 answers
ProtectedData.Unprotect() after Impersonate()
The following code doesn't work:
IntPtr token = Win32Dll.LogonUser(“user1”, “mydomain”, “password1”);
WindowsIdentity id = new WindowsIdentity(token);
WindowsImpersonationContext ic = id.Impersonate();
byte[] unprotectedBytes =…

Andrey
- 21
- 1
- 2
1
vote
1 answer
RegistryPermission error when call from a C# console app
Just looking for some pointer before I head down the wrong path. I have written small C# console app that opens, reads, writes and deletes from our users registry under both HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER
Of course, I got it to work on my…

Skittles
- 897
- 1
- 15
- 24
1
vote
0 answers
If I'm developing a Blazor Server Side App with Windows Authentication, how can I get the logged-in user's picture?
@Ogglas stated:
If you create a new project and choose Blazor with Windows Authentication you get a file called Shared\LoginDisplay.razor with the following content:
Hello, @context.User.Identity.Name!
My…

Jim G.
- 15,141
- 22
- 103
- 166
1
vote
2 answers
"File" does not contain a definition for "SetAccessControl"
I am trying via. C# to change the permission for files.
I get the error message despite correct "using" references. What do I need to do to make this work. I also tried to Nuget following Packeges: System.IO.FileSystem.AccessControl and…

Katzer
- 19
- 2
1
vote
0 answers
Missing System.Security.Claims dll
I am a newbie to ASP.net attempting to publish a .netcore3.1 app to my companies test server; the app compiles and runs fine on my machine and seems to publish okay, but when attempting to run on the server I get:
"HTTP Error 500.19 - Internal…

VivaLebowski
- 113
- 1
- 10
1
vote
1 answer
c# What is the right way to get an RSA key with public exponent 3 from System.Security.Cryptography?
I have a c# program using System.Security.Cryptography (standard provider) that needs to generate RSA keys of a particular bit size and exponent to interface with another long standing system. This code seems reasonable to me:
for (int…

Larry Martin
- 89
- 1
- 10
1
vote
0 answers
Whether registered AES 256 algorithm in the windows will be used internally by the System.Security.Cryptography.ProtectedData by default
if AES 256/256 encryption algorithm is configured in schannel/cipher in the registry in Windows OS then whether AES encryption algorithm will be used internally to encrypt plaintext by the System.Security.Cryptography.ProtectedData in .net…

Vijay
- 11
- 1
1
vote
1 answer
RSACng does not contain a definition for ExportRSAPrivateKey
I have imported System.Security.Cryptography.Cng using NuGet and can instantiate the RSACng class... however, the methods ExportRSAPrivateKey (and ImportRSAPrivateKey) are not there.
I am using version 5.0.0 (latest stable)
According to the…

Brian Rice
- 3,107
- 1
- 35
- 53
1
vote
2 answers
Use .Net Framework class in .Net Core
Hy Everyone!
I'm developing a .Net Core class library project, but I have to use a class from .Net Framework DLL called System.Security, which is unavailable in Core.
(The class is the SignedXml.cs in System.Security.Cryptography.Xml namespace. -…

Julius89
- 19
- 3
1
vote
0 answers
C# Getting System.IO.FileNotFound Exeception
I'm trying to create a program in C# that can manipulate the mouse cursor. I am getting a System.IO exception when I call the method in main and run the program.
I'm doing this in Visual Studio 2019. To run the method below, I am using…

erikmerrill
- 11
- 1
1
vote
1 answer
What does System.Security.Cryptography's DeriveKeyFromHash() actually do?
I'm implementing a security exchange between a C# app and an embedded device programmed in C. System.Security.Cryptography doesn't have documentation on what any of its crypto algorithms do "under the hood". I need to know this in order to implement…

Sarkreth
- 290
- 2
- 10