Dim orgCert As New X509Certificate2()
Dim certbytes As Byte() = Convert.FromBase64String(strOrg(2)) 'this
value in the array contains the cert
orgCert.Import(certbytes)
Console.WriteLine(orgCert.SubjectName)
Console.WriteLine(strOrg(2))
The output for "Console.WriteLine(orgCert.SubjectName)" is simply
"System.Security.Cryptography.X509Certificates.X500DistinguishedName"
instead of the actual SubjectName of the certificate, giving me the
impression that the certificate has somehow gotten mangled.
However, if I take the output of "Console.WriteLine(strOrg(2))" and
copy/paste it to notepad, save as filename.cer, Windows sees it as a
valid certificate. So, what's happening when I try and convert the
base64 encoded string item to a byte array? Any other idea how to do
this? Thanks.
Steve
You are just being mislead by the lack of a good ToString() override on the
X500DistinguishedName class. If you access the Name property of the class,
that will show you what you expect to see.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
<awri...@gmail.com> wrote in message
news:060ed2df-e4c4-462c...@o36g2000yqh.googlegroups.com...
Thanks. Didn't realize I was chasing a non-problem.
Steve