Hi all,
I have a specific problem that is driven by a particular customer installation.
We perform work using self-signed X509 certificates, where we exchange a certificate and then extract the public key to then perform a key exchange.
However, the following code has an unexpected side-effect - it triggers an LDAP request from the machine in what I believe is some kind of domain authentication request.
static void Main( string[] args ) { var certificate = new System.Security.Cryptography.X509Certificates.X509Certificate2(@"E:\Temp\Cert.cer"); System.Security.Cryptography.X509Certificates.PublicKey key = certificate.PublicKey; }
The certificate is very simple for this test - a 512 bit key.
Considering that this certificate is self-signed and not part of the Windows certificate store, I'm not entirely sure why this needs to happen.
Is there a way to extract the certificate without this happening?
- Is there a setting to control this behaviour?
- Is there an alternate call to extract this?
The only alternative I believe that I have at the moment is to perform my own ASN.1 parsing on the byte array from X509Certificate2.GetPublicKey, which means more local implementation of code that is already present in the library.
Can you help?
Thanks,
Darren