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
78
votes
5 answers

Httplistener with HTTPS support

There seems to be a lot of confusing, sometimes conflicting, information with regards to making a .NET HTTPListener HTTPS capable. My understanding is as follows: One's C# code needs an https prefix (for example, https://*:8443) in order for the…
Walter Kelt
  • 2,199
  • 1
  • 18
  • 22
63
votes
10 answers

System.Security.Cryptography.CryptographicException: keyset does not exist

When I make an x509 certificate to encrypt and decrypt messages, I got some error information and could not able to fix this problem. Could someone ever happen to solve this bug? thanks. Description: An unhandled exception occurred during the…
Bes Ley
  • 1,685
  • 1
  • 20
  • 39
61
votes
6 answers

Error Importing SSL certificate : Not an X.509 Certificate

I am trying to Update the SSL certificate in accordance with this post . I am noob in certificates, so i followed this guide. But, when i enter keytool -keystore mycacerts -storepass changeit -importcert -file "C:\Users\Noks\Desktop\cacerts.pem"…
nikel
  • 3,402
  • 11
  • 45
  • 71
60
votes
3 answers

Generate X509Certificate from byte[]?

Is there a possibility to generate an java.security.cert.X509Certificate from an byte[]?
Alex
  • 4,033
  • 9
  • 37
  • 52
59
votes
6 answers

Openssl x509v3 Extended Key Usage

I know you can specify the purpose for which a certificate public key can be used for by adding a line like this one in the openssl.cfg file: extendedKeyUsage=serverAuth,clientAuth But since I have several certificates to create, each with a…
David Caissy
  • 2,181
  • 5
  • 24
  • 26
58
votes
2 answers

How does an SSL certificate chain bundle work?

I've created a chain hierarchy like this. root-ca ==> signing-ca ==> subordinate-ca ==> server It is mentioned to create chain bundle, the lowest should go first. $ cat server.crt subordinate-ca.crt signing-ca.crt > server.pem But verification…
user180574
  • 5,681
  • 13
  • 53
  • 94
56
votes
3 answers

How to add subject alternative name to ssl certs?

I'm using openssl to create self-signed certs. I'm getting this error with the certs I generated: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present Does anyone know how to…
Sapphire
  • 1,107
  • 8
  • 20
  • 35
53
votes
5 answers

Convert a PEM-formatted String to a java.security.cert.X509Certificate

How does one create a java.security.cert.X509Certificate instance from a PEM-formatted String? The PEM-formatted String is a HTTP request "SSL_CLIENT_CERT" header value. ANSWER: Based on mgaert's answer, here's what I wrote in Scala: val cert =…
Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
52
votes
4 answers

How Do We Generate a Base64-Encoded SHA256 Hash of SubjectPublicKeyInfo of an X.509 Certificate, for Android N Certificate Pinning?

The documentation in the N Developer Preview for their network security configuration offers these instructions: Certificate pinning is done by providing a set of certificates by hash of the public key (SubjectPublicKeyInfo of the X.509…
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
50
votes
6 answers

Export P7b file with all the certificate chain into CER file

I have p7b file provided by Thwate.When I am trying to export the certificate in the cer file using the below command, the certificate chain is not included. Please suggest how to do the same. This CER is required for the importing into the…
Kunal Jha
  • 2,102
  • 4
  • 24
  • 34
49
votes
4 answers

Exporting a Certificate as BASE-64 encoded .cer

I am trying to export a cert without the private key as as BASE-64 encoded file, same as exporting it from windows. When exported from windows I am able to open the .cer file in notepad. When I try the following and open on notepad I get binary…
Saif Khan
  • 18,402
  • 29
  • 102
  • 147
49
votes
5 answers

Generate a self-signed certificate on the fly

I searched around, but I didn't find a clear example. I want to create a self-signed (self-)trusted certificate programmatically (C#), following these steps: STEP 1: Create a root CA certificate on the fly and add it to the certificate store in the…
wakeupneo
  • 923
  • 1
  • 10
  • 20
49
votes
5 answers

Get list of certificates from the certificate store in C#

For a secure application I need to select a certificate in a dialog. How can I access certificate store or a part of it (e.g. storeLocation="Local Machine" and storeName="My") using C# and get a collection of all certificates from there?
Kottan
47
votes
5 answers

Creating an X509 Certificate in Java without BouncyCastle?

Is it possible to sanely create an X509 Certificate in Java code without using the Bouncy Castle X509V*CertificateGenerator classes?
Yuliy
  • 17,381
  • 6
  • 41
  • 47
45
votes
10 answers

X509Certificate - Keyset does not exist

I have a WinForms application that consumes a WCF, and pass as a parameter to a function a certificate: mySvcClient.SendDocument(cert.Export(X509ContentType.SerializedCert, "password")); ... In WCF service, I recreated the certificate from the…
BrunoXP
  • 449
  • 1
  • 4
  • 4