code: func extractCertificateHashFromContext(ctx context.Context) []byte {
  	pr, extracted := peer.FromContext(ctx)
  	if !extracted {
  		return nil
  	}
  
  	authInfo := pr.AuthInfo
  	if authInfo == nil {
  		return nil
  	}
  
  	tlsInfo, isTLSConn := authInfo.(credentials.TLSInfo)
  	if !isTLSConn {
  		return nil
  	}
  	certs := tlsInfo.State.PeerCertificates
  	if len(certs) == 0 {
  		return nil
  	}
  	raw := certs[0].Raw
  	if len(raw) == 0 {
  		return nil
  	}
  	return util.ComputeSHA256(raw)
  }
docs: // ExtractCertificateHash extracts the hash of the certificate from the stream