Esempio n. 1
0
 internal void SetToken(X509Certificate2 cert)
 {
     // Parity with WinHTTP: only support retrieval of CBT for ChannelBindingKind.Endpoint.
     _bindingHandle = new SafeChannelBindingHandle(ChannelBindingKind.Endpoint);
     using (HashAlgorithm hashAlgo = Interop.OpenSsl.GetHashForChannelBinding(cert))
     {
         _bindingHash = hashAlgo.ComputeHash(cert.RawData);
         _bindingHandle.SetCertHash(_bindingHash);
         SetHandle(_bindingHandle.DangerousGetHandle());
     }
 }
Esempio n. 2
0
 internal void SetToken(X509Certificate2 cert)
 {
     // Parity with WinHTTP : CurHandler only supports retrieval of ChannelBindingKind.Endpoint for CBT.
     _bindingHandle = new SafeChannelBindingHandle(ChannelBindingKind.Endpoint);
     using (HashAlgorithm hashAlgo = Interop.OpenSsl.GetHashForChannelBinding(cert))
     {
         byte[] bindingHash = hashAlgo.ComputeHash(cert.RawData);
         _bindingHandle.SetCertHash(bindingHash);
         _description = BitConverter.ToString(bindingHash).Replace('-', ' ');
         SetHandle(_bindingHandle.DangerousGetHandle());
     }
 }