System.Security.Cryptography.X509Certificates.X509Chain.Build C# (CSharp) Method

Build() public method

public Build ( System certificate ) : bool
certificate System
return bool
        public bool Build(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)
        {
            throw null;
        }

Same methods

X509Chain::Build ( X509Certificate2 certificate ) : bool
X509Chain::Build ( X509Certificate2 certificate, bool throwOnException ) : bool

Usage Example

        public void SelfSignedTest()
        {
            var chain = new X509Chain();
            var trusted = new X509Certificate2Collection();

            Assert.IsFalse(chain.Build(Certificates.SelfSigned));
            Assert.IsFalse(chain.VerifyWithExtraRoots(Certificates.SelfSigned, trusted));

            trusted.Add(Certificates.SelfSigned);
            Assert.IsTrue(chain.VerifyWithExtraRoots(Certificates.SelfSigned, trusted));
            Assert.IsFalse(chain.Build(Certificates.SelfSigned));

            trusted.Clear();
            Assert.IsFalse(chain.VerifyWithExtraRoots(Certificates.SelfSigned, trusted));
            Assert.IsFalse(chain.Build(Certificates.SelfSigned));
        }
All Usage Examples Of System.Security.Cryptography.X509Certificates.X509Chain::Build