Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>IF you want to do everything including verification of the chain in code then you need to <a href="http://msdn.microsoft.com/en-us/library/ms733806.aspx" rel="nofollow">implement "custom validation" and integrate that into the WCF Host</a>:<br/></p> <pre><code>Client.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.Custom; Client.ServiceCertificate.Authentication.CustomCertificateValidator = new MyCertificateValidator(); </code></pre> <p>For validating the chain yourself you should take a look at <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509chain.aspx" rel="nofollow">X509Chain</a> and <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509store.aspx" rel="nofollow">X509Store</a> - to get an idea how such a chain verification could be implemented take a look at <a href="http://www.java2s.com/Open-Source/CSharp/2.6.4-mono-.net-core/System.Security/System/Security/Cryptography/X509Certificates/X509Certificate2.cs.htm" rel="nofollow">Mono's implementation</a> of the <code>Verify</code>... basically you use the <code>Find</code> method to search a <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate2collection.aspx" rel="nofollow">X509Certificate2Collection</a> for the parent and so on... verification criteria with a custom validation is up to you (valid signature, not expired...).</p> <p>some reference links at MSDN:<br/></p> <ul> <li><p><a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.security.x509servicecertificateauthentication.certificatevalidationmode.aspx" rel="nofollow">X509ServiceCertificateAuthentication.CertificateValidationMode Property</a></p></li> <li><p><a href="http://msdn.microsoft.com/en-us/library/system.identitymodel.selectors.x509certificatevalidator.aspx" rel="nofollow">X509CertificateValidator Class</a></p></li> <li><p><a href="http://msdn.microsoft.com/en-us/library/ms733806.aspx" rel="nofollow">How to: Create a Service that Employs a Custom Certificate Validator</a></p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload