Questions tagged [x509certificate]

X509Certificate is the name of .NET and Java classes for handling X.509 certificates.

X509Certificate is a class for handling X.509 certificates in .NET (MSDN Entry) and in Java (Javadoc).

3174 questions
29
votes
1 answer

How to get X509Certificate from certificate store and generate xml signature data?

How can I get X509Certificate from certificate store and then generate XML SignatureData in .net C#?
valisimo
  • 613
  • 2
  • 9
  • 14
28
votes
3 answers

Which parts of the client certificate to use when uniquely identifying users?

I'm designing a system where users will be able to register and afterward authenticate with client certificates in addition to username/password authentication. The client certificates will have to be valid certificates issued by a configured list…
miha
  • 3,287
  • 3
  • 29
  • 44
28
votes
2 answers

Accessing uploaded certificates in azure web sites

When I was using the web role I was just uploading the certificate in azure portal and I was able to see it .Now I have switched to the website in azure and I uploaded the certificate in the azure management portal but my code does not see it at…
sp9
  • 755
  • 3
  • 11
  • 22
27
votes
1 answer

Load multiple certificates into PKCS12 with openssl

I am trying to load multiple certificates using openssl into the PKCS12 format. The command is as follows: openssl pkcs12 -export -in cert1.arm -inkey cert1_private_key.pem -certfile cert2.arm -certfile cert3.arm -certfile RootCert.pem -name "Test"…
Mohammad Khodaei
  • 501
  • 1
  • 4
  • 15
27
votes
1 answer

X509Certificate2 makes IIS crash

When newing up an instance of X509Certificate2(string, string) my IIS process simply crashes. No .Net exception, no nothing, except of this in my event log Faulting application name: w3wp.exe, version: 8.0.9200.16384, time stamp: 0x50108835 Faulting…
Pauli Østerø
  • 6,878
  • 2
  • 31
  • 48
26
votes
1 answer

Encrypt / Decrypt in C# using Certificate

I'm having trouble finding a good example in encrypting / decrypting strings in C# using a certificate. I was able to find and implement an example of signing and validating a signature, as shown below. Could someone point me to an easy, similar…
Ilya
  • 995
  • 1
  • 11
  • 17
26
votes
2 answers

How to make WCF Client conform to specific WS-Security - sign UsernameToken and SecurityTokenReference

I need to create a wcf client to call a service that I have no control over. I have been given a wsdl and a working soapui project. The service uses both a username/password and a x509 certificate. UPDATE I now understand what the problem is, but…
Steve B
  • 473
  • 1
  • 4
  • 14
25
votes
2 answers

C# How can I validate a Root-CA-Cert certificate (x509) chain?

Let's say I have three certificates (in Base64 format) Root | --- CA | --- Cert (client/signing/whatever) How can I validate the certs and certificate path/chain in C#? (All those three certs may not be in my computer cert store) …
Jacob
  • 435
  • 1
  • 6
  • 12
25
votes
4 answers

How to create a minimal dummy X509Certificate2?

I'm unit testing a .NET application; some of the unit tests involve programmatically generating X509Certificate2 objects. I don't care about actual signing/private key/validation stuff, I'd just like to have an object that doesn't throw exceptions…
Cephron
  • 1,577
  • 1
  • 19
  • 26
25
votes
3 answers

HTTPS request fails using HttpClient

I am using the following code and get HttpRequestException exception: using (var handler = new HttpClientHandler()) { handler.ClientCertificateOptions = ClientCertificateOption.Manual; handler.SslProtocols = SslProtocols.Tls12; …
hcp
  • 3,268
  • 6
  • 26
  • 41
24
votes
3 answers

Add certificate on request with RestSharp

I'm trying to communicate with a server. This server send me a certificate and a private key in order to execute my request successfully. To test the server, I use Postman. So I fill the certificate setting in postman, and my request works fine Now…
dpfauwadel
  • 3,866
  • 3
  • 23
  • 40
24
votes
1 answer

Load X509 certificate from disk .Net Core

I've created an X509 certificate using OpenSSL. I am trying to load it using the Import method on the X509Certificate2 class, in .NET Core 2.0. var cert = new X509Certificate2(); cert.Import(_path); But get thrown the following…
BlackSpy
  • 5,563
  • 5
  • 29
  • 38
24
votes
2 answers

C# / .NET - How to allow a "custom" Root-CA for HTTPS in my application (only)?

Okay, here is what I need to do: My application, written in C# (.NET Framework 4.5), needs to communicate with our server via HTTPS. Our server uses a TLS/SSL certificate issued by our own Root-CA. That Root-CA, while perfectly trusted by my…
dtr84
  • 241
  • 1
  • 2
  • 10
24
votes
3 answers

Implementing X509TrustManager - passing on part of the verification to existing verifier

I need to ignore the PKIX path building exception javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExc ption: unable to find valid…
user93353
  • 13,733
  • 8
  • 60
  • 122
23
votes
7 answers

Install User Certificate Via ADB

Is there a way to install CA certificate (.crt file) under the Security -> Trusted Credential -> User tab via ADB? or any other "scriptable" way.
Nir Duan
  • 6,164
  • 4
  • 24
  • 38