I see that X509Certificate only has a method for reading from a file.
I have some proxy code that is called multiple times and I don't want
to read from a file every time. Is there a way to read that CER into
a MemoryStream and use that instead of file-read?
Thanks.
"Peter Huang" - 19 Oct 2004 04:55 GMT
Hi
Based on my experience, there is no method in .net framework to load a
X509Certificate from memory.
But if we have used the code below to load certificate from file to
X509Certificate object, we can just use the cert ,
X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);
or we can contruct a new X509Certificate from a X509Certificate instance.
public X509Certificate(X509Certificate);
If I have any misunderstanding, please feel free to post here.
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Eugene Mayevski - 19 Oct 2004 15:48 GMT
Hello!
You wrote on Mon, 18 Oct 2004 15:26:25 -0400:
l> I see that X509Certificate only has a method for reading from a file.
l> I have some proxy code that is called multiple times and I don't want
l> to read from a file every time. Is there a way to read that CER into
l> a MemoryStream and use that instead of file-read?
You can do what you need with freeware PKIBlackbox ( http://www.secureblackbox.com/description-sec-pkiblackbox.html)
which has a good structure of classes and lets you perform the necessary
operations with 1 method call.
With best regards,
Eugene Mayevski