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
1907
votes
23 answers

How to generate a self-signed SSL certificate using OpenSSL?

I'm adding HTTPS support to an embedded Linux device. I have tried to generate a self-signed certificate with these steps: openssl req -new > cert.csr openssl rsa -in privkey.pem -out key.pem openssl x509 -in cert.csr -out cert.pem -req -signkey…
michelemarcon
  • 23,277
  • 17
  • 52
  • 68
479
votes
37 answers

curl: (60) SSL certificate problem: unable to get local issuer certificate

root@sclrdev:/home/sclr/certs/FreshCerts# curl --ftp-ssl --verbose ftp://{abc}/ -u trup:trup --cacert /etc/ssl/certs/ca-certificates.crt * About to connect() to {abc} port 21 (#0) * Trying {abc}... * Connected to {abc} ({abc}) port 21 (#0) <…
user3812540
  • 4,815
  • 3
  • 12
  • 4
193
votes
3 answers

What does the 'Z' mean in Unix timestamp '120314170138Z'?

I have an X.509 certificate which has the following 2 timestamps: ['validFrom'] = String(13) "120314165227Z" ['validTo'] = String(13) "130314165227Z" What does the postfix character 'Z' mean. Does it specify the timezone?
HomeCoder
  • 2,465
  • 3
  • 18
  • 20
133
votes
1 answer

How can I generate a self-signed certificate with SubjectAltName using OpenSSL?

I am trying to generate a self-signed certificate with OpenSSL with SubjectAltName in it.While I am generating the csr for the certificate, my guess is I have to use v3 extensions of OpenSSL x509. I am using : openssl req -new -x509 -v3 -key…
mohanjot
  • 1,490
  • 2
  • 11
  • 15
133
votes
1 answer

What exactly happens when I set LoadUserProfile of IIS pool?

I faced the following issue. I run the following code var binaryData = File.ReadAllBytes(pathToPfxFile); var cert = new X509Certificate2(binaryData, password); in two processes. One of the processes runs under LOCAL_SYSTEM and there this code…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
123
votes
4 answers

What is the difference between X509Certificate2 and X509Certificate in .NET?

What is the difference between the two?
Kyle
  • 17,317
  • 32
  • 140
  • 246
110
votes
21 answers

How to extract CN from X509Certificate in Java?

I am using a SslServerSocket and client certificates and want to extract the CN from the SubjectDN from the client's X509Certificate. At the moment I call cert.getSubjectX500Principal().getName() but this of course gives me the total formatted DN of…
Martin C.
  • 12,140
  • 7
  • 40
  • 52
104
votes
7 answers

CryptographicException was unhandled: System cannot find the specified file

I am trying to embrace the mysteries of SSL communication and have found a great tutorial on this site. I was trying to test my own certificate. Using Visual Studio 2012, I simply added an existing file (my certificate in .pfx format) and then…
Storm
  • 3,062
  • 4
  • 23
  • 54
99
votes
14 answers

Problems with X509Store Certificates.Find FindByThumbprint

I'm having a problem when I use the method X509Store.Certificates.Find public static X509Certificate2 FromStore(StoreName storeName, StoreLocation storeLocation, X509FindType findType, string findValue) { X509Store store = new…
nunofamel
  • 989
  • 2
  • 7
  • 5
98
votes
13 answers

How to display the Subject Alternative Name of a certificate?

The closest answer that I found is using "grep". > openssl x509 -text -noout -in cert.pem | grep DNS Is there better way to do this? I only prefer command line. Thanks.
user180574
  • 5,681
  • 13
  • 53
  • 94
96
votes
10 answers

Authentication failed because remote party has closed the transport stream

I am developing a TCP client to connect OpenSSL server with the certificate authentication. I have using .crt and .key files shared by server team. These certificates are generated by OpenSSL commands. I am using SslStream object to authenticate the…
Odelu
  • 969
  • 1
  • 7
  • 7
96
votes
7 answers

How to find certificate by its thumbprint in C#

I am using this code to find the certificate by its thumbprint. certificate exists in certificate manager in personal certificate store but this code is not finding that certificate. Please tell me where I'm doing wrong in it. namespace…
RATHI
  • 5,129
  • 8
  • 39
  • 48
81
votes
9 answers

X509Certificate Constructor Exception

//cert is an EF Entity and // cert.CertificatePKCS12 is a byte[] with the certificate. var certificate = new X509Certificate(cert.CertificatePKCS12, "SomePassword"); When loading a certificate from our database, on our staging server (Windows…
lukiffer
  • 11,025
  • 8
  • 46
  • 70
79
votes
2 answers

"An internal error occurred." when loading pfx file with X509Certificate2

I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath("~/App_Data/myhost.pfx"), "pass"); on a shared web hosting server and I got an error: System.Security.Cryptography.CryptographicException:…
tmp3128
78
votes
2 answers

Importing the private-key/public-certificate pair in the Java KeyStore

I used the following steps to create a new Java keystore with a pair of private/public key to be used by a Java (internal) server with TLS. Please notice that the certificate is selfsigned: 1) Generate key with AES256 openssl genrsa -aes256 -out…
kingston
  • 11,053
  • 14
  • 62
  • 116
1
2 3
99 100