static SecurityMessageProperty CreateServerSecurity(NegotiateStream negotiateStream)
 {
     GenericIdentity remoteIdentity = (GenericIdentity)negotiateStream.RemoteIdentity;
     string principalName = remoteIdentity.Name;
     if ((principalName != null) && (principalName.Length > 0))
     {
         ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies = SecurityUtils.CreatePrincipalNameAuthorizationPolicies(principalName);
         SecurityMessageProperty result = new SecurityMessageProperty();
         result.TransportToken = new SecurityTokenSpecification(null, authorizationPolicies);
         result.ServiceSecurityContext = new ServiceSecurityContext(authorizationPolicies);
         return result;
     }
     else
     {
         return null;
     }
 }