Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decode a CSR File?

I ran accross a CSR file (Certificate Signing Request) and I need to extract some information from it.

There's a way to decode it using .NET Framework?

like image 562
Romias Avatar asked Oct 14 '08 13:10

Romias


People also ask

How do you decrypt a CSR file?

Decoding a CSR is easy if you employ the OpenSSL.NET library: // Load the CSR file var csr = new X509Request(BIO. File("C:/temp/test. csr", "r")); OR var csr = new X509Request(@"-----BEGIN CERTIFICATE REQUEST-----..."); // Read CSR file properties Console.

How do you read a CSR certificate?

To check CSRs and view the information encoded in them, simply paste your CSR into the box below and our CSR Decoder will do the rest. Your CSR should start with "-----BEGIN CERTIFICATE REQUEST----- " and end with "-----END CERTIFICATE REQUEST----- ".


3 Answers

It's not .NET, but for interactive use, try the OpenSSL utilities. Specifically:

openssl req -text -in request.csr 
like image 199
erickson Avatar answered Sep 22 '22 09:09

erickson


certutil -dump file.csr

Will also dump all relevant information. Builtin in Windows by default.

like image 36
BZanten Avatar answered Sep 19 '22 09:09

BZanten


Decoding a CSR is easy if you employ the OpenSSL.NET library:

// Load the CSR file
var csr = new X509Request(BIO.File("C:/temp/test.csr", "r"));
OR
var csr = new X509Request(@"-----BEGIN CERTIFICATE REQUEST-----...");

// Read CSR file properties
Console.WriteLine(csr.PublicKey.GetRSA().PublicKeyAsPEM);
Console.WriteLine(csr.Subject.SerialNumber);
Console.WriteLine(csr.Subject.Organization);
.
.
.

X509Request type has properties to get everything out of your CSR file text.

like image 31
Ε Г И І И О Avatar answered Sep 21 '22 09:09

Ε Г И І И О