Binding.CertificateHash Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the hash of the certificate to bind.
public:
property cli::array <System::Byte> ^ CertificateHash { cli::array <System::Byte> ^ get(); void set(cli::array <System::Byte> ^ value); };
public byte[] CertificateHash { get; set; }
member this.CertificateHash : byte[] with get, set
Public Property CertificateHash As Byte()
Property Value
The byte array that represents the Secure Sockets Layer (SSL) binding hash.
Examples
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: " +
binding.CertificateStoreName;
}
Remarks
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.