System.Security.Cryptography.X509Certificates.X509CertificateCollection.GetHashCode C# (CSharp) Method

GetHashCode() public method

public GetHashCode ( ) : int
return int
        public override int GetHashCode()
        {
            int hashCode = 0;
            foreach (X509Certificate cert in List)
            {
                hashCode += cert.GetHashCode();
            }
            return hashCode;
        }

Usage Example

 internal SecureChannel(string hostname, bool serverMode, SchProtocols protocolFlags, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus, EncryptionPolicy encryptionPolicy, LocalCertSelectionCallback certSelectionDelegate)
 {
     if (Logging.On)
     {
         Logging.PrintInfo(Logging.Web, this, ".ctor", string.Concat(new object[] { "hostname=", hostname, ", #clientCertificates=", (clientCertificates == null) ? "0" : clientCertificates.Count.ToString(NumberFormatInfo.InvariantInfo), ", encryptionPolicy=", encryptionPolicy }));
     }
     SSPIWrapper.GetVerifyPackageInfo(GlobalSSPI.SSPISecureChannel, "Microsoft Unified Security Protocol Provider", true);
     if (ComNetOS.IsWin9x && (clientCertificates.Count > 0))
     {
         this.m_Destination = hostname + "+" + clientCertificates.GetHashCode();
     }
     else
     {
         this.m_Destination = hostname;
     }
     this.m_HostName = hostname;
     this.m_ServerMode = serverMode;
     if (serverMode)
     {
         this.m_ProtocolFlags = protocolFlags & SchProtocols.ServerMask;
     }
     else
     {
         this.m_ProtocolFlags = protocolFlags & SchProtocols.ClientMask;
     }
     this.m_ServerCertificate = serverCertificate;
     this.m_ClientCertificates = clientCertificates;
     this.m_RemoteCertRequired = remoteCertRequired;
     this.m_SecurityContext = null;
     this.m_CheckCertRevocation = checkCertRevocationStatus;
     this.m_CheckCertName = checkCertName;
     this.m_CertSelectionDelegate = certSelectionDelegate;
     this.m_RefreshCredentialNeeded = true;
     this.m_EncryptionPolicy = encryptionPolicy;
 }