Questions tagged [x509certificate2]

.NET Class for handling X.509 Certificates

922 questions
16
votes
1 answer

Importing ECC-based certificate from the Windows Certificate Store into CngKey

How can I get the public/private keys from an ECC-based X509Certificate2's into CngKey's for use with ECDsaCng and ECDiffieHellmanCng? I'm currently using RSA 2048 bit key pairs to sign/encrypt stuff. I'm doing this by pulling the certificates from…
Dan Turner
  • 2,233
  • 18
  • 19
15
votes
4 answers

Client certificate not getting added to the request (Certificate Verify)

I'm trying to do a simple GET request to an external production server with a client certificate. They have added our certificate to their server, and I have successfully made requests through Postman (both the Chrome app and the Windows native app)…
Aske B.
  • 6,419
  • 8
  • 35
  • 62
15
votes
5 answers

How to serialize and deserialize a PFX certificate in Azure Key Vault?

I have a bunch of strings and pfx certificates, which I want to store in Azure Key vault, where only allowed users/apps will be able to get them. It is not hard to do store a string as a Secret, but how can I serialize a certificate in such way that…
zdebyman
  • 550
  • 1
  • 4
  • 22
13
votes
4 answers

Certutil asking to connect a Smart Card

I am trying to run certutil -repairstore and keep getting prompted for a smart card. This is a VM on AWS and a smart card is not an option. Any thoughts on how to bypass the smart card and get the repair to complete are appreciated
13
votes
3 answers

Private key is null when accessing via code, why?

I have a certificate installed on my machine and when I go to view it, I see the message "You have a private key that corresponds to this certificate" however, when I try to access that private key in code, it is null. I use the following code to…
Brian David Berman
  • 7,514
  • 26
  • 77
  • 144
12
votes
3 answers

Exporting X.509 certificate WITHOUT private key

I thought this would be straightforward but apparently it isn't. I have a certificate installed that has a private key, exportable, and I want to programmatically export it with the public key ONLY. In other words, I want a result equivalent to…
Aaronaught
  • 120,909
  • 25
  • 266
  • 342
12
votes
3 answers

X509Certificate2 - the system cannot find the path specified

I wish to get the data of Google analytics via service account. When I launch first time the application, everything works correctly and I have access to the data. But When I launch second time the application I have the following error which…
user2285964
  • 121
  • 1
  • 1
  • 4
12
votes
1 answer

The request was aborted: Could not create SSL/TLS secure channel

Possible Duplicate: The request was aborted: Could not create SSL/TLS secure channel I am trying to send a http request with a client side certificate. The file, in this case a .p12 file. However when it reaches the line responseStream =…
Rutger
  • 1,163
  • 3
  • 12
  • 29
11
votes
2 answers

How do I get the X509Certificate sent from the client in web service?

Apparently I was asking the wrong question in my earlier post. I have a web service secured with a X.509 certificate, running as a secure web site (https://...). I want to use the client's machine certificate (also X.509) issued by the company's…
DaveN59
  • 3,638
  • 8
  • 39
  • 51
11
votes
4 answers

read client certificate from httprequest C#

I am trying to read an X509 certificate using Request.ClientCertificate but nothing is returned. The certificate is definitely being attached to the request because I can get the certificate information from the page sending the request. I have…
Sean
  • 1,502
  • 3
  • 12
  • 20
11
votes
4 answers

Export private key from X509Certificate object

We use C# code we build X509Certificate2 with .p12 file, in the constructor we insert the path to certificate, certificate's password. We also marked it as Exportable as shown below: X509Certificate2 x509Certificate2 = new…
RRR
  • 3,937
  • 13
  • 51
  • 75
11
votes
7 answers

DOD Common Access Card (CAC) Authentication

I have figured out all the necessary steps to get DOD CAC card based client certificate authentication working in Apache, but am now struggling to pull a good GUID for the user from the certificate I am receiving. Is there a GUID available on the…
Jim
11
votes
3 answers

EncryptedXml DecryptDocument method error after .Net framework update

I have an old function written in 2013 that decrypt xml that was encrypted by another program. The code is realy simple public static void Decrypt(XmlDocument Doc) { // Check the arguments. if (Doc == null) …
11
votes
1 answer

Read Remote Machine Certificate

We can use the X509store to load the store and find the certificates in local machine but how to do the same for a certificate sitting on remote server? I know we can configure a network account to have permissions on the certificate in remote…
Rakesh Vasu
  • 155
  • 1
  • 8
11
votes
4 answers

Prevent file creation when X509Certificate2 is created?

We create a X509Certificate2 object in our ASP.NET app to make periodic outgoing connections. Every time one of these certificates is created a new file is created in: C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys That folder now has 4 million…
DougN
  • 4,407
  • 11
  • 56
  • 81
1 2
3
61 62