CertificateHash Property

CertificateHash Property

IIS 7.0

Gets or sets the hash of the certificate to bind.

Namespace:  Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

public byte[] CertificateHash { get; set; }

Property Value

Type: array<System..::..Byte>[]()[][]
The byte array that represents the Secure Sockets Layer (SSL) binding hash.

The CertificateHash property contains the certificate hash for the SSL binding. The certificate hash is the unique identifier for the certificate.

The CertificateHash property is available only when the protocol identifier defined by the Protocol property is "https". An attempt to get or set the CertificateHash property for a binding with a protocol of "http" will raise an error.

The value of the CertificateHash property is set in the BindingCollection object.

The following example demonstrates the CertificateHash property. If the protocol identifier is "https", the certificate hash and certificate store name are displayed. This code example is part of a larger example provided for the Binding class.

if (binding.Protocol == "https")
     // There is a CertificateHash and  
     // CertificateStoreName for the https protocol only.
    bindingdisplay = bindingdisplay + "\n   CertificateHash: " + 
        binding.CertificateHash + ": ";
    // Display the hash.
    foreach (System.Byte certhashbyte in binding.CertificateHash)
        bindingdisplay = bindingdisplay + certhashbyte.ToString() + " ";
    bindingdisplay = bindingdisplay + "\n   CertificateStoreName: " + 

Community Additions

© 2015 Microsoft