PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
How to read .cer file?-VBForums
Results 1 to 6 of 6

Thread: How to read .cer file?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    757

    How to read .cer file?

    Hi All,

    How to read .cer file in Net Core 3.0?

    I tried:

    Code:
     string cer = @"D:\\Downloads\\certificate.cer";
     
    var _try1= new X509Certificate2(File.ReadAllBytes(cer));
    X509Certificate2 _try2= new X509Certificate2(cer,"");
    all above returning: {"Cannot find the requested object."}

    please help

    thanks

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,130

    Re: How to read .cer file?

    I don't know the answer to your question specifically but the documentation for the constructor specifies what file formats are supported for CER files. Does your file comply with one of those formats?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    757

    Re: How to read .cer file?

    I successfully convert pfx to cer file using

    openssl pkcs12 -in mypfx.pfx -out certificate.cer -nodes

    so I also don't know whether produced .cer file is compatible with x509 or not..

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    757

    Re: How to read .cer file?

    I successfully convert pfx to cer file using

    openssl pkcs12 -in mypfx.pfx -out certificate.cer -nodes

    so I also don't know whether produced .cer file is compatible with x509 or not..

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,130

    Re: How to read .cer file?

    I just realised that this doesn't make sense:
    csharp Code:
    1. string cer = @"D:\\Downloads\\certificate.cer";
    The whole point of a verbatim string literal is that you don't have to escape slashes. Either use a verbatim string literal or don't, i.e. use this:
    csharp Code:
    1. string cer = @"D:\Downloads\certificate.cer";
    or this:
    csharp Code:
    1. string cer = "D:\\Downloads\\certificate.cer";
    I'm not sure whether the incorrect path format would be compensated for automatically or not but I would think not. I'm not inclined to test for myself right now.

  6. #6
    Banned
    Join Date
    Dec 2019
    Posts
    9

    Re: How to read .cer file?

    Hi! Check out this thread, it might be of help https://stackoverflow.com/questions/...parse-cer-file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width