Renamed Client/ServerCredential.
The credential implementations should indicate in their name that they are implementations of the 'current' credential (acquired from the login running the process).
This commit is contained in:
@@ -5,13 +5,13 @@ namespace NSspi.Credentials
|
||||
/// <summary>
|
||||
/// Represents the credentials of the user running the current process, for use as an SSPI client.
|
||||
/// </summary>
|
||||
public class ClientCredential : CurrentCredential
|
||||
public class ClientCurrentCredential : CurrentCredential
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ClientCredential class.
|
||||
/// </summary>
|
||||
/// <param name="package">The security package to acquire the credential handle from.</param>
|
||||
public ClientCredential( string package )
|
||||
public ClientCurrentCredential( string package )
|
||||
: base( package, CredentialUse.Outbound )
|
||||
{
|
||||
}
|
||||
@@ -5,14 +5,14 @@ namespace NSspi.Credentials
|
||||
/// <summary>
|
||||
/// Represents the credentials of the user running the current process, for use as an SSPI server.
|
||||
/// </summary>
|
||||
public class ServerCredential : CurrentCredential
|
||||
public class ServerCurrentCredential : CurrentCredential
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ServerCredential class, acquiring credentials from
|
||||
/// the current thread's security context.
|
||||
/// </summary>
|
||||
/// <param name="package">The name of the security package to obtain credentials from.</param>
|
||||
public ServerCredential( string package )
|
||||
public ServerCurrentCredential( string package )
|
||||
: base( package, CredentialUse.Inbound )
|
||||
{
|
||||
}
|
||||
@@ -55,18 +55,18 @@
|
||||
<Compile Include="Contexts\ContextQueryAttrib.cs" />
|
||||
<Compile Include="Contexts\ImpersonationHandle.cs" />
|
||||
<Compile Include="Contexts\SafeContextHandle.cs" />
|
||||
<Compile Include="Credentials\ClientCurrentCredential.cs" />
|
||||
<Compile Include="Credentials\CurrentCredential.cs" />
|
||||
<Compile Include="Credentials\ServerCurrentCredential.cs" />
|
||||
<Compile Include="EnumMgr.cs" />
|
||||
<Compile Include="SecPkgInfo.cs" />
|
||||
<Compile Include="Contexts\ServerContext.cs" />
|
||||
<Compile Include="Credentials\ClientCredential.cs" />
|
||||
<Compile Include="Credentials\Credential.cs" />
|
||||
<Compile Include="Credentials\CredentialNativeMethods.cs" />
|
||||
<Compile Include="Credentials\CredentialQueryAttrib.cs" />
|
||||
<Compile Include="Credentials\CredentialUse.cs" />
|
||||
<Compile Include="Credentials\QueryNameSupport.cs" />
|
||||
<Compile Include="Credentials\SafeCredentialHandle.cs" />
|
||||
<Compile Include="Credentials\ServerCredential.cs" />
|
||||
<Compile Include="NativeMethods.cs" />
|
||||
<Compile Include="PackageSupport.cs" />
|
||||
<Compile Include="PackageNames.cs" />
|
||||
|
||||
@@ -16,10 +16,10 @@ namespace NSspi
|
||||
|
||||
private static void CredTest( string packageName )
|
||||
{
|
||||
ClientCredential clientCred = null;
|
||||
ClientCurrentCredential clientCred = null;
|
||||
ClientContext client = null;
|
||||
|
||||
ServerCredential serverCred = null;
|
||||
ServerCurrentCredential serverCred = null;
|
||||
ServerContext server = null;
|
||||
|
||||
byte[] clientToken;
|
||||
@@ -30,8 +30,8 @@ namespace NSspi
|
||||
|
||||
try
|
||||
{
|
||||
clientCred = new ClientCredential( packageName );
|
||||
serverCred = new ServerCredential( packageName );
|
||||
clientCred = new ClientCurrentCredential( packageName );
|
||||
serverCred = new ServerCurrentCredential( packageName );
|
||||
|
||||
Console.Out.WriteLine( clientCred.PrincipleName );
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TestClient
|
||||
public partial class ClientForm : Form
|
||||
{
|
||||
private ClientContext context;
|
||||
private ClientCredential cred;
|
||||
private ClientCurrentCredential cred;
|
||||
|
||||
private CustomConnection connection;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace TestClient
|
||||
this.FormClosing += Form1_FormClosing;
|
||||
|
||||
// --- SSPI ---
|
||||
this.cred = new ClientCredential( PackageNames.Negotiate );
|
||||
this.cred = new ClientCurrentCredential( PackageNames.Negotiate );
|
||||
|
||||
this.context = new ClientContext(
|
||||
cred,
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TestServer
|
||||
|
||||
public partial class ServerForm : Form
|
||||
{
|
||||
private ServerCredential serverCred;
|
||||
private ServerCurrentCredential serverCred;
|
||||
|
||||
private ServerContext serverContext;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace TestServer
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.serverCred = new ServerCredential( PackageNames.Negotiate );
|
||||
this.serverCred = new ServerCurrentCredential( PackageNames.Negotiate );
|
||||
|
||||
this.serverContext = new ServerContext(
|
||||
serverCred,
|
||||
|
||||
Reference in New Issue
Block a user