"ANSI bad file tag"....cannot read certificate

From: shahid (fake_at_microsoft.com)
Date: 11/23/04

  • Next message: S R Tripathy: "Re: certificates and ASP.NET"
    Date: Tue, 23 Nov 2004 14:44:22 +0500
    
    

    Hi all,

    i am trying to read a certificate serialized on the hard disk. when i try to
    read this certificate using ifstream, "ANIS bad file tag" message is
    displayed.
    i am using the following code:

            ifstream certIn;
                certIn.open("C:\\atemp.cer");
                certIn.seekg(0,ios::end);
                int nSize = certIn.tellg();
                certIn.seekg(0,ios::beg);
                char cert[nSize];
                certIn.read(cert,nSize);
                certIn.close();

    Regards


  • Next message: S R Tripathy: "Re: certificates and ASP.NET"