<commit_before>﻿using System;
using System.Text;
using NSspi.Contexts;
using NSspi.Credentials;

namespace NSspi
{
    public class Program
    {
        public static void Main( string[] args )
        {
            CredTest();
        }

        private static void CredTest()
        {
            ClientCredential clientCred = null;
            ClientContext client = null;

            ServerCredential serverCred = null;
            ServerContext server = null;

            byte[] clientToken;
            byte[] serverToken;

            SecurityStatus clientStatus;
            SecurityStatus serverStatus;

            try
            {
                clientCred = new ClientCredential( PackageNames.Negotiate );
                Console.Out.WriteLine( clientCred.Name );

                client = new ClientContext( 
                    clientCred, 
                    "", 
                    ContextAttrib.MutualAuth | 
                    ContextAttrib.InitIdentify |
                    ContextAttrib.Confidentiality |
                    ContextAttrib.ReplayDetect |
                    ContextAttrib.SequenceDetect | 
                    ContextAttrib.Connection |
                    ContextAttrib.Delegate
                );

                serverCred = new ServerCredential( PackageNames.Negotiate );

                server = new ServerContext(
                    serverCred,
                    ContextAttrib.MutualAuth |
                    ContextAttrib.AcceptIdentify |
                    ContextAttrib.Confidentiality |<commit_msg>Restructured the demo a little bit to exercise the common security packages.<commit_after>﻿using System;
using System.Text;
using NSspi.Contexts;
using NSspi.Credentials;

namespace NSspi
{
    public class Program
    {
        public static void Main( string[] args )
        {
            CredTest( PackageNames.Negotiate );
            CredTest( PackageNames.Kerberos );
            CredTest( PackageNames.Ntlm );
        }

        private static void CredTest( string packageName )
        {
            ClientCredential clientCred = null;
            ClientContext client = null;

            ServerCredential serverCred = null;
            ServerContext server = null;

            byte[] clientToken;
            byte[] serverToken;

            SecurityStatus clientStatus;
            SecurityStatus serverStatus;

            try
            {
                clientCred = new ClientCredential( packageName );
                serverCred = new ServerCredential( packageName );

                Console.Out.WriteLine( clientCred.Name );

                client = new ClientContext( 
                    clientCred, 
                    serverCred.Name, 
                    ContextAttrib.MutualAuth | 
                    ContextAttrib.InitIdentify |
                    ContextAttrib.Confidentiality |
                    ContextAttrib.ReplayDetect |
                    ContextAttrib.SequenceDetect | 
                    ContextAttrib.Connection |
                    ContextAttrib.Delegate
                );


                server = new ServerContext(
                    serverCred,
                    ContextAttrib.MutualAuth |
                    ContextAttrib.AcceptIdentify |
                    ContextAttrib.Confidentiality |
{'fraction_non_alphanumeric': 0.05527031108426457, 'fraction_numerical': 0.0, 'mean_word_length': 1.3844492440604752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7207253', 'n_tokens_mistral': 749, 'n_tokens_neox': 695, 'n_words': 165}